扫描字符串文字时,在第8行EOL上出现错误。
我已经尝试过缩进行并添加反斜杠,但没有任何效果。
HumanPlayer(Player)类:
def move(self):
move_choice = input('rock, paper, scissors, SHOOT! >')
while move_choice != 'rock'and move_choice != '
'paper'and move_choice != 'scissors':
print('Sorry that entry is invalid, please try again')
move_choice = input('rock, paper, scissors,SHOOT! >')
return (move_choice)
答案 0 :(得分:0)
您有一个额外的'
,并且没有在开始的那一行上完成while
语句。由于您希望它跨越多行,因此请添加\
,这称为显式行连续
def move(self):
move_choice = input('rock, paper, scissors, SHOOT! >')
while move_choice != 'rock'and move_choice != \
'paper'and move_choice != 'scissors':
print('Sorry that entry is invalid, please try again')
move_choice = input('rock, paper, scissors,SHOOT! >')
return (move_choice)