We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e3e77c commit bc0abb9Copy full SHA for bc0abb9
head_tail_random_module.py
@@ -0,0 +1,28 @@
1
+import random
2
+print("Welcome to the head-tail Game..!!")
3
+
4
+round=5
5
+user_head=0
6
+computer_head=0
7
8
+for toss in range(1,round+1):
9
+ print(f"\n Toss:{toss}")
10
11
+ user_result=random.choice(["head","tail"])
12
+ print("User:",user_result)
13
14
+ computer_result=random.choice(["head","tail"])
15
+ print("Computer:",computer_result)
16
17
+ if user_result=="head":
18
+ user_head+=1
19
+ if computer_result=="head":
20
+ computer_head+=1
21
22
+# ✅ Final winner check loop नंतर
23
+if user_head>computer_head:
24
+ print("User WINS the Game!")
25
+elif computer_head>user_head:
26
+ print("Computer WINS the Game!")
27
+else:
28
+ print("Match DRAW!")
0 commit comments