Skip to content

Commit fbd735b

Browse files
Merge pull request geekcomputers#404 from sakshamjn/patch-1
Guessing_Game
2 parents 5407880 + 825ef0e commit fbd735b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Guessing_Game

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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

0 commit comments

Comments
 (0)