Try this, and look carefully at the differences between
player
and
pla
, and
computer
and
comp
. Also the first
if
statement should use the
and
operator, not
or
.
print("Let's play Stone(1), Paper(2), Sissors(3)")
import random
computer=random.randint(1,3)
if computer==1:
comp="stone"
elif computer==2:
comp="paper"
elif computer==3:
comp="sissors"
print(comp)
player=int(input("It's your chance|1 for Stone| 2 for Paper| 3 for Sissors|:\n"))
if player==1:
pla="Stone"
elif player==2:
pla="Paper"
elif player==3:
pla="Sissors"
else:
pass
print(pla)
if player==1 and computer==2:
print("Computer:Paper\n Player:Stone \n Computer wins!")
elif player==1 and computer==3:
print("Computer:sissors\n Player:Stone \n Player wins!")
elif player==1 and computer==1:
print("Computer:Stone\n Player:Stone \n Draw!")
elif player==2 and computer==1:
print("Computer:Stone\n Player:Paper \n Player Wins!")
elif player==2 and computer==3:
print("Computer:Sissors\n Player:Paper \n Computer Wins!")
elif player==2 and computer==2:
print("Computer:Paper\n Player:Paper \n Draw!")
elif player==3 and computer==2:
print("Computer:Paper\n Player:Sissors \n Player wins!")
elif player==3 and computer==1:
print("Computer:Stone\n Player:Sissors \n Computer wins!")
elif player==3 and computer==3:
print("Computer:Sissors\n Player:Sissors \n Draw!")
This could be simplifies considerably by the use of some of Python's list types, but I leave that as an exercise for you.