random number between 0 and 100 inclusive and does not display it on the screen. using function : random.randint(1,100) • The player must guess the value of this number by typing his proposal on the keyboard. • The program displays as appropriate: – "Won" if the player has guessed the right number. The program ends immediately. – "Too big" if the player has entered a number larger than the right price. – "Too small" if the player has entered a number smaller tha
we will now develop a small game whose rules are as follows:
• The program draws a random number between 0 and 100 inclusive and does not display it on the screen. using function : random.randint(1,100)
• The player must guess the value of this number by typing his proposal on the keyboard.
• The program displays as appropriate:
– "Won" if the player has guessed the right number. The program ends immediately.
– "Too big" if the player has entered a number larger than the right price.
– "Too small" if the player has entered a number smaller than the right price
- The player has only 5 tries before the program ends by displaying the
message 'Lost!'. If the player wins after X tries, the program should display "Won after X tries!".
. at the end of each game, the message "Do you want to start again? (y/n)" is displayed.
If the user types 'y', a new part of the game starts, if he types 'n', the program ends by displaying
how many tries it took the player on average (over all the games played) to find the right answer.
Example :
Guess the mysterious number! 50
Too small!
Try again: 75
Too small!
Try again: 82
Too big!
Try again: 78
Won after 4 tries!
The mysterious number was indeed 78 .
Do you want to do it again? (y/n) y
Guess the mysterious number! 50
Too big!
Try again: 25
Too big!
Try again: 12
Won after 3 tries!
The number mystere was well 12 .
Do you want to do it again? (y/n) n
Finished. Number of average tests: 3.5
Please answer it in Python
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)