repl.it
@JerryTheMouse/

Markov Chain Attempt

Python

No description

fork
loading
Files
  • main.py
  • input.jerry
  • loremIpsum.source
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
f = open('input.jerry', 'r')

text = f.readline()
print("text contains: " + str(text))

words = []
a = ''
currWord = ''

print('\nNo initialization errors')
print("Beginning word count algorithm...\n")

# Sorts words into list
for char in text:
  # print (char)
  if char not in " ":
    currWord += char
    print (char)
  elif char in ' ':
    words.append(currWord)
    print ("Now, words contain " + str(words))
    
?