不确定这里是否有错误,在第19行出现语法错误。删除冒号会使错误向前移动。我认为这可能与缩进有关,但我不确定。
import time
import random
print('Scissors? Paper? or Rock?')
playerchoice = input()
if playerchoice == 'rock' | 'Rock' | 'ROCK' | 'r' | 'R':
playerval = 1
elif playerchoice == 'scissors' | 'Scissiors' | 'SCISSORS' | 's' | 'S':
playerval = 2
elif playerchoice == 'paper' | 'Paper' | 'PAPER' | 'p' | 'P':
playerval = 3
else:
print('Invalid input')
roboval = (random.randint(0,4)
if roboval == 3 & playerval == 1:
playerval = 4
if playerval == 3 & roboval == 1:
roboval = 4
if playerval > roboval:
resultwin = 1
else:
resultwin = 0