Problems with scripts
Lauren Fugate
lauren.sophia1998 at gmail.com
Mon Feb 13 13:03:05 EST 2017
So I changed my code to this:
print("How old are you: 17, 18, 19, or 20?")
answer = input("> ")
if int(answer) == 17 or 18 or 19 or 20:
print("Wow, you are old!")
else:
print("You just can't follow drections, can you? Choose either 17, 18, 19, or 20.")
input("> ")
and now if I input any of the preferred answers it will print "Wow, you are old!" like it should. But if I enter a word, like "hi", it will return an error.
More information about the Python-list
mailing list