Here’s what I’ve tried doing. Simply I purposely put a capital T in one of the "the"s to test out the example given. Do I possibly need to try a raw_input in? I’m only about half way through the curriculum but wanted to reach out as it’s been bugging me.
Below is the code that works but I get " the 3", I want it to be 4
name = input('Enter a file name: ')
handle = open(name)
counts = dict()
for line in handle :
words = line.split()
for word in words :
counts[word] = counts.get(word,0) +1
bigcount = None
bigword = None
for word,count in counts.items() :
if bigcount is None or count > bigcount:
bigword = word
bigcount = count
print(bigword, bigcount)