-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathr_p_s.py
37 lines (31 loc) · 898 Bytes
/
r_p_s.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# import some lib
# best for if else practice
from random import randint
print("This is a Rock, Paper, Scissors game of Chance ")
player = input('rock(r),paper(p),scissors(s) ?')
print(player, 'vs', end=' ')
# setting for random chocie of cpu
cpu_chocie = randint(1, 3)
# print(cpu_chocie)
# checking which are they choosing
if cpu_chocie == 1:
computer = 'r'
elif cpu_chocie == 2:
computer = 'p'
else:
computer = 's'
print(computer)
if player == computer:
print('Draw !')
elif player == 'r' and computer == 's':
print("PLAYER WIN !")
elif player == 'r' and computer == 'p':
print("COMPUTER WIN !")
elif player == 'p' and computer == 'r':
print("PLAYER WIN !")
elif player == 'p' and computer == 's':
print("COMPUTER WIN !")
elif player == 's' and computer == 'p':
print("PLAYER WIN !")
elif player == 's' and computer == 'r':
print("COMPUTER WIN !")