Create another Guess the Number game. · Python randomly chooses a secret four-digit number (with no repeating digits) and asks the user to guess it. · The user has up to ten attempts to guess the...


Create another Guess the Number game.


· Python randomly chooses a secret four-digit number (with no repeating digits) and asks the user to guess it.


· The user has up to ten attempts to guess the number. After each guess, Python gives the user two clues (until the user either guesses the number correctly or runs out of attempts):


o The number of digit(s) in the user’s guess that is (are) both correct and in the right position.


o The number of digit(s) in the user’s guess that is (are) correct but in the wrong position.


§ For example, say the secret number is 0123.


· If the user’s guess is 4567, the clues will be:


o Right digit and position: 0


o Right digit but wrong position: 0


· If the user’s guess is 1023, the clues will be:


o Right digit and position: 2


o Right digit but wrong position: 2


· If the user guesses the correct number within his/her ten attempts, the game will finish.


· If the user fails to guess the correct number within his/her ten attempts, the number will be shown and the game will finish.


· When the game finishes (i.e., whether the user guesses the correct number or fails to do so in ten attempts), Python asks the user whether he/she wants to continue playing.


o If the user enters “Y” he/she will play another round. If the user enters “N” the game will end.

Oct 07, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here