Question: 9 . 6 Random Number Guessing Game ( No User Input ) In this assignment, you will create a Python program that generates a random
Random Number Guessing Game No User Input
In this assignment, you will create a Python program that generates a random number with a seed value and provides hints to the user. Your goal is to determine the random number based on the provided hints. This modified version of a guessing game doesn't require user input but simulates the guessing process for you.
Task:
Your program should complete the following tasks:
Import the random module to enable random number generation.
Set a seed value of your choice using the random.seed function for reproducibility.
Generate a random integer between and inclusive and store it in a variable targetnumber.
Simulate a guessing game without user input. Provide the following hints to help you determine the random number:
"The number is lower than if the number is less than "The number is higher than if the number is greater than "You guessed correctly!" if you correctly guess the number. Print a congratulatory message after you guess the correct number and the number of attempts it took you to guess correctly.
Instructions:
Start by importing the random module to enable random number generation.
Set a seed value to using random.seed to ensure reproducibility.
Generate a random integer between and and store it in the targetnumber variable. This is the number you'll try to guess.
The program will simulate a guessing game for you. It will generate random guesses and provide hints based on those guesses.
The goal is to guess the targetnumber based on the provided hints. When you guess correctly, the program will congratulate you and tell you how many attempts it took.
Example Output:
Welcome to the Random Number Guessing Game!
Hint: The number is higher than
Hint: The number is lower than
Hint: The number is lower than
Hint: The number is lower than
Hint: The number is lower than
You guessed correctly! Congratulations! You determined the number.
Number of attempts:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
