-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimport random.py
More file actions
44 lines (42 loc) · 1.49 KB
/
import random.py
File metadata and controls
44 lines (42 loc) · 1.49 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
import random
a=['sang', 'kagaz', 'ghychi']
computer=random.choice (a)
man=input("Enter a choice (sang, kagaz, ghychi): ")
if computer == "sang" and man =="ghychi":
print("bkhti")
elif computer == "ghychi" and man =="sang":
print("bordi")
elif computer == "kagaz" and man == "ghychi":
print("bordi")
elif computer == "ghychi" and man == "kagaz":
print("bkhti")
elif computer == "sang" and man == "kagaz":
print("bordi")
elif computer == "kagaz" and man == "sang":
print("bkhti")
else:
print("mosavi")
print(f"man {computer} entkhab karde bodam")
print(f"\nYou chose {man}, computer chose {computer}.\n")
# user_action = input("Enter a choice (rock, paper, scissors): ")
# possible_actions = ["rock", "paper", "scissors"]
# computer_action = random.choice(possible_actions)
# print(f"\nYou chose {user_action}, computer chose {computer_action}.\n")
#
# if user_action == computer_action:
# print(f"Both players selected {user_action}. It's a tie!")
# elif user_action == "rock":
# if computer_action == "scissors":
# print("Rock smashes scissors! You win!")
# else:
# print("Paper covers rock! You lose.")
# elif user_action == "paper":
# if computer_action == "rock":
# print("Paper covers rock! You win!")
# else:
# print("Scissors cuts paper! You lose.")
# elif user_action == "scissors":
# if computer_action == "paper":
# print("Scissors cuts paper! You win!")
# else:
# print("Rock smashes scissors! You lose.")