-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrock-paper-scissors.py
More file actions
42 lines (36 loc) · 923 Bytes
/
rock-paper-scissors.py
File metadata and controls
42 lines (36 loc) · 923 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# create a python game where the user plays rock-paper-scissors
# against the computer until they type "quit".
# The computer's choice should be random
import random
# a=1
# b=6
# print(random.randint(a,b))
number = random.randint(0,2)
while True:
user_move = input("Input something: ")
# if user_move == "quit":
# break
if(number == 0 ):
print("Rock")
if user_move == "Rock":
print("Draw")
elif (user_move == "Scissors"):
print("Computer wins")
else:
print("User Wins!!")
elif(number==1):
print("Scissors")
if user_move == "Rock":
print("User Wins!!")
elif (user_move == "Scissors"):
print("Draw")
else:
print("Computer wins!!")
else:
print("Paper")
if user_move == "Rock":
print("Computer Wins!!")
elif (user_move == "Scissors"):
print("User Wins!!")
else:
print("Draw")