Skip to content

Commit 5107d37

Browse files
authored
Guessing Game
1 parent b37bf08 commit 5107d37

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Guessing Game

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import random
2+
userGuess = int(input("Enter your guessed no. b/w 0-100:"))
3+
a = comGuess = random.randint(0,100)
4+
5+
6+
while true:
7+
comGuess=random.randint(0,100)
8+
if userGuess>comGuess:
9+
print("Guess Higher")
10+
comGuess = random.randint(a,100)
11+
a++
12+
13+
elif userGuess < comGuess:
14+
print("Guess Lower")
15+
comGuess = random.randint(0,a)
16+
a++
17+
18+
else :
19+
print ("Guessed Corectly")
20+
break
21+
22+
23+
24+

0 commit comments

Comments
 (0)