So I'm kinda stuck on this one program I am trying to write and idk what is wrong. The question says to write a program to guess the computer's randomly chosen number until you guess it correctly. This is a sample of what the code should produce:
Output:Guessing game
Instructions: Try to guess the number between 1 and 100.
Enter number (1 to 100): 50
Too low! Enter number (1 to 100): 100
Too high! Enter number (1 to 100): 75
Too low! Enter number (1 to 100): 90
Too high! Enter number (1 to 100): 85
Too high! Enter number (1 to 100): 80
Too high! Enter number (1 to 100): 78
Too low! Enter number (1 to 100): 79
That's correct!
It took you 8 tries to correctly guess 79
And... This is the code I have so far but something isn't right about it:print("Guessing game") print("\nInstructions:\tTry to guess the number between 1 and 100.") import random number = random.randint(1,100) number2 = int(input("\nEnter number (1 to 100): ")) while number2 < number: guess_number = int(input("Too low! Enter number (1 to 100): ")) while number2 > number: guess_number = int(input("Too high! Enter number (1 to 100): ")) if number == guess_number: print("That's correct!")Any help would be great! Thanks!