Question
NUMBER GAME (PYTHON) Guess My Number Create a program for the user to guess what number the computer has selected. Provide feedback to the user
NUMBER GAME (PYTHON)
Guess My Number Create a program for the user to guess what number the computer has selected. Provide feedback to the user if the number is too high or too low. About: The program will generate a random number between 1 - 1000. The user will then guess the number. The program should reply back if the guess is too high, too low, or guessed the correct one. Input: User enters a number until the correct number is guessed. Process: Use a loop to continue the user to prompt the user until the correct number is guess. A conditional statement is used to test if the number is too high; otherwise the number is going to be low. Output: The program output if the number is too high or too low. When the correct number is guessed, the program outputs, "You guessed my number:" Sample:
Guess my number between 1 - 1000.
Your number: 34 Your number is too low.
Enter another number: 88 Your number is too high.
Enter another number: 55
Awesome!!! You guessed my number
Hints:
Use a Loop with an if conditional statement
Need to use the random module Guess my number between 1 - 1000. Your number: 34 Your number is too low. Enter another number: 88 Your number is too high. Enter another number: 55 Awesome!!! You guessed my number. Notes:
The Loop should only work until the guessed number is equal to the random number
The if statement should only check if the number is either too high or too low
Make sure the output looks clean and neat
Include program header information at the top of your code: # Name: # Program Name: # Program Description: Challenge Code: (10 extra points)
Have the program prompt the user if they would like to play again
During game play, if the user enters 0 (zero) they quit out of the program Example: < Too high. Enter another number (or 0 to quit): >
Include user stats at the end, such as: Total Guesses: _____ Guesses too high: _____ Guesses too low: ______
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started