I keep getting errors in the 4th line
import random
rsplist = ["Scissors", "Rock", "Paper"]
mine = input('Please give me one of scissors, rock, paper, etc.)>')
computer = random.choice(rsplist)
def qustion():
if mine == computer:
print('You're {}, the computer's {} It's a tie!"format(mine, computer))
again()
else:
If mine == 'Scissors':
If computer == 'Rock':
print('You're {}, the computer's {} I lost... '.format(mine, computer))
again()
else:
print('You're {}, the computer's {} I won! '.format(minine, computer))
again()
else:
If mine == 'Rock':
if computer == 'Bo':
print('You're {}, the computer's {} I lost... '.format(mine, computer))
again()
else:
print('You're {}, the computer's {} I won! '.format(minine, computer))
again()
else:
If mine == 'Bo':
if computer == 'Scissors':
print('You're {}, the computer's {} I lost... '.format(mine, computer))
again()
else:
print('You're {}, the computer's {} I won! '.format(minine, computer))
again()
else:
print('It's weird! Give me either rock, paper, or scissors.')
again()
def again():
answer = input ('Do you want to do it again? (Yes/No')
If answer == 'Yes':
qustion()
else:
if answer == 'No':
print ('I'm sorry')
else:
print('Yes/No' please... Let me ask you again.')
again()
qustion()
The fourth line is mine = input(') Please give one of scissors, rock, or paper>') If you mean
, I think you turned the script back to Python2 that you should have turned to Python3. When running a Python script
Run with python3 <ScriptName>
or
Or change input
to raw_input
in the code.
© 2024 OneMinuteCode. All rights reserved.