-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrock,paper,scissor.py
More file actions
28 lines (24 loc) · 875 Bytes
/
rock,paper,scissor.py
File metadata and controls
28 lines (24 loc) · 875 Bytes
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
print(' Welcome to game of (Rock,Paper and Scissors)')
print('Here your oppponent is none other than AI')
name = input('Enter your name :')
print("Hello",name,'!')
import random
item_list = [ 'Rock','Paper','Scissor']
count = 0
comp_choice = random.choice(item_list)
while True :
user_choice = input('What you want to choose : Rock,Paper or Scissor : ')
if user_choice == comp_choice:
print("The game is TIE between you and our AI.")
else :
if (
(user_choice == 'Rock' and comp_choice == 'Scissor')or
(user_choice == 'Paper' and comp_choice == 'Rock')or
(user_choice == 'Scissor' and comp_choice == 'Paper')
):
print(f"The {user_choice} is won against {comp_choice}.")
count += 1
continue
else :
print(f"The {user_choice} is got lose against {comp_choice}.")
print(f"Your score is {count}.")