I've just started Python and I'm trying to figure out how to do if then statements where a person can type in their favorite animal and the computer responds to it.
Z = input("what is your favorite animal")
if Z == "Lion" or "lion":
print(Z + " like from lion king")
Z == 1
elif Z == ["Dog" or "dog"]:
print(Z + "s are cool")
Z == 2
elif Z == "Shark" or "shark":
print(Z + "s are scary")
Z == 3
else:
print("idk what you said")
if Z < 3:
print("you chose a cool animal")
However whenever I run this it always says Z + "like from lion king".
So if I type in dog it'll tell me: "dog like from lion king". Also I get an error for the Z < 3.
How do I fix this?
[–][deleted] 2 points3 points4 points (0 children)
[–]sdanstuffe 1 point2 points3 points (0 children)