-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEx8.py
More file actions
61 lines (56 loc) · 2.35 KB
/
Copy pathEx8.py
File metadata and controls
61 lines (56 loc) · 2.35 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
'''Make a two-player Rock-Paper-Scissors game.
(Hint: Ask for player plays (using input), compare them, print out a message of congratulations to the winner, and ask if the players want to start a new game).
Remember the rules:
Rock beats scissors
Scissors beats paper
Paper beats rock'''
import random
while True:
choice_list = ["Rock", "Paper", "Scissors"]
my_selection = random.choice(choice_list)
user_selection = input("What is your pick out of Rock, Paper, Scissors? ")
if user_selection == "Rock" and my_selection == "Rock":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("We are tied!")
break
if user_selection == "Rock" and my_selection == "Paper":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have lost!")
break
if user_selection == "Rock" and my_selection == "Scissors":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have won!")
break
if user_selection == "Paper" and my_selection == "Rock":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have won!")
break
if user_selection == "Paper" and my_selection == "Paper":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("We are tied!")
break
if user_selection == "Paper" and my_selection == "Scissors":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have lost!")
break
if user_selection == "Scissors" and my_selection == "Rock":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have lost!")
break
if user_selection == "Scissors" and my_selection == "Paper":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("You have won!")
break
if user_selection == "Scissors" and my_selection == "Scissors":
print("You have selected", user_selection)
print("I have selected", my_selection)
print("We are tied!")
break