An example of dictionary accumulation from the chapter:
Dictionary Accumulation
T = "tale of the old tale of the new" Book = T.split() Accum = { } for word in Book: Accum[word] = Accum.get(word,0) + 1 # now display the table for word in Accum: print(word,Accum[word])
T = "tale of the old tale of the new"
Book = T.split()
Accum = { }
for word in Book:
Accum[word] = Accum.get(word,0) + 1
# now display the table
for word in Accum:
print(word,Accum[word])
Forward
Backward