Question: PYTHON At the start of the game, Rose and Sam agree on the number of turns to play. Rose then thinks of a number from
PYTHON


At the start of the game, Rose and Sam agree on the number of turns to play. Rose then thinks of a number from 1 to 100 that she wants Sam to guess. Each turn, Sam tells Rose his guess. Rose then replies with "Higher!" if the number she's thinking of is higher than Sam's guess, "Lower!" if her number is lower than Sam's, or "You win!" if Sam guesses the number correctly. If Sam has used up all of his turns and has not guessed the number correctly, Rose replies with "Sorry, better luck next time! The answer was __." Help them write a computer program to simulate their game! Input Format The first line is an integer n, the number of turns to play. The second line is an integer X, the number Rose wants Sam to guess. Each of the next m lines contains a guess Y by Sam. Constraints 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
