user_word = input("guess a word: ")
with open("C:/Users/Callum_test/Documents/Python/dog.txt") as dictionary:
if user_word is dictionary.read():
print("Well done, you got a", len(user_input), "letter word")
else:
print("That's not a word!")
Hello,
I've created the above code but for some reason it can't find the word in the file? I've not done anything like this for a while and have no idea how to get it working. The code functions seemingly fine but no input is found in the text file.
thanks, Callum
user_word = input("guess a word: ").strip('\n')is, change toin:if user_word in dictionary.read():