Condition (or) help


#1

I need help because I put a list of ways a condition could run right here.
What I want is it to respond "I forgot for "Yes" "Ok" etc and it doesnt work.

joke = input("Wanna hear joke?: ")

if (joke == "No" or "no"):
print("To Bad!")
elif (joke == "Yes" or "yes" or "yeah" or "Yeah" or "ok" or "Ok" or "Sure" or "sure"):
print("I Forgot")
else:
print("I dont understand")

bored = input("Are you Bored?: ")
if (bored == "Yes" or "yes" or "yeah" or "Yeah" or "ok" or "Ok" or "Sure" or "sure"):
magic = input("I can do a Magic Trick for You!: ")
magic = input("Think of a Number in your Head and type 'done' when you are ready ")
print("Know times that number by 2 and I bet it is an EVEN Number")
else:
print("I will do it anyway")
magic = input("Ok? ")
magic = input("Think of a Number in your Head and type 'done' when you are ready. ")
print("Know times that number by 2 and I bet it is an EVEN Number")


#2

I am using Python 3 btw


#3

That expression is evaluated as: (joke == "No") or ("no")
As you see, there is no comparison between "no" and joke


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.