Guess my Number

Guess my Number


Program:


from random import randint

biggestNumber = 10
randomNumber = randint(1,biggestNumber)
counter = 1

while True:
    try:
        guess = int(input("Guess a number"))
        if guess < biggestNumber:
            if guess > randomNumber:
                print("Guess lower")
                counter += 1

            elif guess < randomNumber:
                print("Guess Higher")
                counter += 1

            elif guess == randomNumber:
                print("You got it in", counter, "tries")
                break
        else:
            print("Guess numbers less than", biggestNumber)

    except:
        print("Error Try again")