Question: 9.10 Python Assignment: Guess a Number You will create a program that selects a number from 1 to 100. The user will guess the number,

 9.10 Python Assignment: Guess a Number You will create a program

9.10 Python Assignment: Guess a Number You will create a program that selects a number from 1 to 100. The user will guess the number, - Select a random integer in the range [1,100] write the following at the top of your code import randon random.seed (300) Note: The line random. seed (300) will lock your random into a specific number each time it runs . Use number-random.randint (1, 100) to generate your random number Tell the user that a number between 1 and 100 has been chosen While the selected number has not been guessed. Prompt user to enter a guess Compare guess to selected number Print 'too high', too low.' or 'you got it!" Print the number of guesses the user took to guess the number Sample input/output: .Note: Be sure to match every character, including punctuation. If the tester throws an error that says: EOF Error: EOF when reading a line, that means your code is looping longer than it should. A number between 1 and 100 has been chosen Take a guess: 50 Your guess is too LON Take a guess: 75 Your guess is too LOW Take a guess: 87 Your guess is too HIGH Take a guess: 81 Your guess is too HIGH Take a guess: 78 Your guess is too HIGH Take a guess: 76 Your guess is too LoW Take a guess: 77 You got it! It took you 7 guesses

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!