Hi I was working on a python guessing game where the computer chooses a number and the user tries to guess the number. Now I want to add a feature to count the number of guesses a user made before getting the correct number. I think for that we need to count the number of inputs. What should I add to reach that goal?Here is my code so far:
print("Welcome to the Guessing Game. In this game, I will choose a random number between 1 and 100 and your goal will be to guess the number I choose. I will tell you if the number you guess is higher or lower than my choice. Lets Start.")
a = random.randint(0, 100)
print("I have chosen my number. Lets start !")
b = int(input("Enter guess"))
while b != a:
if a < b:
print("LOWER")
if a > b:
print("HIGHER")
b = int(input("Enter guess"))
print("You WIN")