This is my code,
if diff != "1" or diff != "2" or diff != "3":
print("You need to pick either 1, 2 or 3
")
For some reason, the outcome is,
Pick a difficulty:
1) Easy
2) Medium
3) Hard
>> 2
You need to pick either 1, 2 or 3
I want the if statement to check if the variable diff is not equal to strings 1, 2 and 3. But when I put either 1, 2 or 3, the error message for when diff doesn't equal the numbers prints instead. Why does this happen?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…