On 06/01/2015 05:56 PM, Alan Gauld wrote:
if text in line:
count += 1
print("This word appears", count, "times in the file")
And this is, of course, completely off track. You need
to split the line into its separate words and store
each word into the dictionary.
OP may want to research the setdefault and get methods for dictionaries.
SDG,
tom
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor