Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use www.repl.it to solve this question. this question uses the concept of Array & List. Thank you! Write a python program that plays the game

use www.repl.it to solve this question. this question uses the concept of Array & List. Thank you!

image text in transcribed
Write a python program that plays the game of 'guess the number' as follows: Your program should automatically choose a random number to be guessed by selecting an integer at random in the range 1 to 1000. Then ask the player to guess the number. The player then types a guess. The program responds with one of the following : 1. Excellent! You guessed the number! Would you like to play again ( 1=yes, 2=no )? 2. Too low. Try again. 3. Too high. Try again. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program should keep telling the player 'Too high' or 'Too low' to help the player guess the correct answer. Important Rules: 1. Make sure you use the function randrange in random module to make your game really randomize. No other random function is allows. 2. The output responses must follow exactly the above output list. Especially highlighted word should be used appropriately. 3. Failed to follow above rules might result the system not able to grade you correctly. 4. Program flow must follow the sample output. Sample Output: guess the number game= your guess?100 Too low. Try again your guess?500 Too low. Try again your guess?800 Too high. Try again your guess?600 Too low. Try again your guess?700 Too high. Try again your guess?650 Too low. Try again your guess?680 Too low. Try again your quesa?690 Too low. Try again your guess?699 Too high. Try again your guess?695 Too high. Try again your guess?693 Excellent! You guessed the number! would you like to play again (1-yes, 2-no) ? your guess?500 Too high. Try again your guess?250 Too low. Try again your guess?350 Too high. Try again your guess?300 Too low. Try again your quesa?350 Too high. Try again your guess?340 Too high. Try again your guess?330 Too high. Try again your guess?320 Too low. Try again your guess?325 Too high. Try again your guess?323 Too low. Try again your quess?324 Excellent! You guessed the number! would you like to play again (1=yes, 2-no) ? 2 Thanks for playing the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

\f

Answered: 1 week ago