“if variable not in list”不工作,所有时间返回true

2024-05-19 20:54:48 发布

您现在位置:Python中文网/ 问答频道 /正文

为什么这行代码总是返回true?你知道吗

def GetPlayersMove(self):
    self.move = input("Enter Rock, Paper or Scissors: ")
    if self.move.lower() not in ["rock" "paper", "scissors"]:
        print("Error")

Tags: or代码selftrueinputmoveifdef