Skip to content

Commit c49c587

Browse files
Ryan MitchellRyan Mitchell
authored andcommitted
Simplified things with a "+= 1"
1 parent 38d31ab commit c49c587

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chapter8/3-markovGenerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def buildWordDict(text):
3737
wordDict[words[i-1]] = {}
3838
if words[i] not in wordDict[words[i-1]]:
3939
wordDict[words[i-1]][words[i]] = 0
40-
wordDict[words[i-1]][words[i]] = wordDict[words[i-1]][words[i]] + 1
40+
wordDict[words[i-1]][words[i]] += 1
4141

4242
return wordDict
4343

0 commit comments

Comments
 (0)