Posts

Showing posts with the label Guessing an Integer Number in a Range

Guessing an Integer Number in a Range in Python

Image
                                               Guessing an Integer Number in a Range Problem statement       The objective is to randomly generate integer number from 0 to n.  Then the player has to guess the number. If the player guesses the number correctly output an appropriate message.      If the guessed number is less than the random number generated, output the message "Your guess is lower than the number.  Guess again." , otherwise output the message "Your guess is higher than the number.  Guess again:.      Then the player guesses another number.  This process is repeated until the player guesses the correct number.   Algorithm       1.  Start.       2.  Generate a random numbers and read num.           ...