Skip to content

Commit 73bf0f2

Browse files
authored
Update Guessing_Game.py
1 parent 338c606 commit 73bf0f2

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Guessing_Game.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33
a = comGuess = randint(0, 100) # a and comGuess is initialised with a random number between 0 and 100
44

55
while True: # loop will run until encountered with the break statement(user enters the right answer)
6-
76
userGuess = int(input("Enter your guessed no. b/w 0-100:")) # user input for guessing the number
87

98
if userGuess < comGuess: # if number guessed by user is lesser than the random number than the user is told to guess higher and the random number comGuess is changed to a new random number between a and 100
109
print("Guess Higher")
1110
comGuess = randint(a, 100)
1211
a += 1
13-
count=1
1412

1513
elif userGuess > comGuess: # if number guessed by user is greater than the random number than the user is told to guess lower and the random number comGuess is changed to a new random number between 0 and a
1614
print("Guess Lower")
1715
comGuess = randint(0, a)
1816
a += 1
19-
count=1
20-
21-
22-
elif userGuess == comGuess and count==0 :#the player needs a special reward for perfect guess in the first try ;-)
23-
print("Bravo! Legendary Guess!")
2417

25-
else:#Well, A Congratulations Message For Guessing Correctly!
18+
else: #Well, A Congratulations Message For Guessing Correctly!
2619
print("Congratulations, You Guessed It Correctly!")

0 commit comments

Comments
 (0)