-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameRockPaperScissors.py
More file actions
66 lines (54 loc) · 1.29 KB
/
GameRockPaperScissors.py
File metadata and controls
66 lines (54 loc) · 1.29 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
rock = '''
_______
---' ____)
(_____)
(_____)
(____)
---.__(___)
'''
paper = '''
_______
---' ____)____
______)
_______)
_______)
---.__________)
'''
scissors = '''
_______
---' ____)____
______)
__________)
(____)
---.__(___)
'''
#Write your code below this line 👇
import random
mychoice = input("rock, paper ou scissors?>>")
choices = [rock, paper, scissors]
if mychoice == "rock":
mychoice = rock
print(f"My choice is:{rock}")
choices = [paper,scissors]
computer_choice = random.choice(choices)
print(f"Computer's choice is: {computer_choice}")
elif mychoice == "paper":
mychoice = paper
print(f"My choice is:{paper}")
choices = [rock,scissors]
computer_choice = random.choice(choices)
print(f"Computer's choice is: {computer_choice}")
elif mychoice == "scissors":
mychoice = scissors
print(f"My choice is:{scissors}")
choices = [paper,rock]
computer_choice = random.choice(choices)
print(f"Computer's choice is: {computer_choice}")
if mychoice == rock and computer_choice == scissors:
print("You win")
elif mychoice == scissors and computer_choice == paper:
print("You win")
elif mychoice == paper and computer_choice == rock:
print("You win")
else:
print("Computer wins")