-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrockpapersiccors.py
44 lines (40 loc) · 1.09 KB
/
rockpapersiccors.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
38
39
40
41
42
43
44
import random
points = 0
chances = 5
def start():
print("Hi everyone. Lets play rock paper siccors.")
start()
i = 0
while i <= chances:
game = ["rock", "paper", "scissors"]
pc = random.choice(game)
player = input("enter your choice")
if player not in game:
print("invalid input")
else:
i+=1
print("PC played", pc)
if pc == "rock":
if player == "rock":
pass
if player == "paper":
points += 1
if player == "scissors":
points -= 1
elif pc == "paper":
if player == "rock":
points -= 1
if player == "paper":
pass
if player == "scissors":
points += 1
elif pc == "scissors":
if player == "rock":
points += 1
if player == "paper":
points -= 1
if player == "scissors":
pass
else:
print("gameover ")
print("you scored ", points)