# Write a program that reads the words in words.txt and stores them as keys in a dictionary. It doesn’t matter what the values are. Then you can use the in operator as a fast way to check whether a string is in the dictionary.

fname = input('file: ')
if len(fname) == 0:
    fname = 'words.txt'

fhand = open(fname)

words = dict()
for line in fhand:
    word = line.split()
    for w in word:
        words[w] = words.get(w, 0) + 1

print(words)
