-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext.py
More file actions
38 lines (23 loc) · 736 Bytes
/
text.py
File metadata and controls
38 lines (23 loc) · 736 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
import random
options=("stone","paper","scissors")
running=True
while running:
player=None
computer=random.choice(options)
while player not in options:
player=input("Enter your choice (stone,paper,scissors ):")
print(f"player: {player}")
print(f"computer: {computer}")
if player == computer:
print("It's a tie ! ")
elif player=="stone" and computer=="scissors":
print("You win ! ")
elif player=="paper" and computer=="stone":
print("You win ! ")
elif player=="scissors" and computer=="paper":
print("You win ! ")
else:
print("You lose ! ")
if not input("play again? (yes/no): ").lower()== "yes":
running=False
print("Thanks for playing")