Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please update the provided pseudocode by re-writing it into Python code, such that the guessing game allows a player at most 10 attempts to guess
Please update the provided pseudocode by re-writing it into Python code, such that the guessing game allows a player at most 10 attempts to guess a random integer between O and 100 (inclusive). After each guess the program will say whether the answer is too low, too high, or correct, and after 10 guesses or one correct guess the game will end. At the end of the game the program will say the player has won or lost. secret-number = generate a random number between guess = -1 while secret-number != guess and 100 guess = get a guess input from player if guess secret_number say "your guess is low" else if guess secret_number say "your guess is high" else say "you guessed right! end if end while
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