This question already has an answer here:
I have looked for an answer to my question, but it seems there are none for my problem specifically. Which has lead me to believe this is a simple error.
def intest():
choice = raw_input("> ")
if "hello" or "world" in choice:
print "There is hello or world in 'choice'"
elif "bye" or "cya" in choice:
print "There is bye or cya in 'choice'"
else:
print "Go again"
return intest()
intest()
When run, no matter what is typed in the raw_input
, the first if-statement
is the one that executes. What is the problem?
Aucun commentaire:
Enregistrer un commentaire