Dec-01-2021, 04:32 PM
(This post was last modified: Dec-01-2021, 04:38 PM by Yoriz.
Edit Reason: Added code tags
)
#!/bin/python3
from random import randint
player = input('Paper(p), Scissors(s), or Rock(r).')
print(player, 'vs', end= ' ')
chosen = randint(1,3)
#print(chosen)
if chosen == 1:
computer = 'r'
elif chosen == 2:
computer = 'p'
else:
computer = 's'
print(computer)
if player ==chosen:
print('DRAW!!!!')
elif player == 'R' and computer == 'S':
print("Player wins!!")
elif player == 'R' and computer == 'P':
print('Computer wins!!')
elif player == 'P' and computer == 'R':
print("Player wins!!")
elif player == 'P' and computer == 'S':
print('Computer wins!!')
elif player == 'S' and computer == 'P':
print("Player wins!!")
elif player == 'S' and computer == 'R':
print('Computer wins!!')
