在python的while语句中使用!=操作有什么特别的规则。例如我有这样的代码循环不等于(!=)操作在while循环中不起作用
input("f_l value ")
while f_l != "s" or f_l != "S" or f_l != "q" or f_l != "Q":
print("Error")
input("f_l value ")
print("your f_l is correct")
while循环不会停止并打印值。我不知道为什么。有任何想法吗?
您还没有分配给'f_l' ... – rlbond
[执行块可能的复制,如果一个变量不某些特定值之一](http://stackoverflow.com/questions/26337003/execute-block-if-a-variable-is-not-one-of-some-specific-values) – Barmar
'或'应该是'和'。 – Barmar