from random import randintbiggestNumber = 10randomNumber = randint(1,biggestNumber)counter = 1while 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")