为什么这行代码总是返回true?
def GetPlayersMove(self):
self.move = input("Enter Rock, Paper or Scissors: ")
if self.move.lower() not in ["rock" "paper", "scissors"]:
print("Error")
答案 0 :(得分:12)
代码遗失,
。
["rock" "paper", "scissors"]
# ^
"rock" "paper"
相当于"rockpaper"
:
>>> ["rock" "paper", "scissors"]
['rockpaper', 'scissors']
>>>