I am relatively new to python and have to write a code for a "Countdown" based game; the program would basically ask the user for a word, see whether it is located in a file of words, and if it isn't print (directly after the word input by the user) "is invalid".
And here is what I see on my screen now, relative to what I have been asked for.
I'm also new to this forum so apologies in advance if this post isn't as polished as others!
Many thanks in advance to anyone willing to help, it's greatly appreciated!
You could do something like this:
def wordcheck(word):
if ...:
return word + " is valid"
else:
return word + " is invalid"
print("Proposed word: {0} ".format(wordcheck(input())))
Where "if ..." is you checking if the word is valid