Function Requirements:
guess_number
that takes no parameters.Input:
Output:
When the user plays the game, the interaction might look like this:
Welcome to the Number Guessing Game!
Guess a number between 1 and 100.
Enter your guess: 50
Too low! Try again.
Enter your guess: 75
Too high! Try again.
Enter your guess: 60
Congratulations! You've guessed the number 60 in 3 attempts.
random
module to select a random number.input()
to get the user’s guess and convert it to an integer.