()
| 7 | |
| 8 | |
| 9 | def askForGuess(): |
| 10 | while True: |
| 11 | guess = input('> ') # Enter the guess. |
| 12 | |
| 13 | if guess.isdecimal(): |
| 14 | return int(guess) # Convert string guess to an integer. |
| 15 | print('Please enter a number between 1 and 100.') |
| 16 | |
| 17 | |
| 18 | print('Guess the Number, by Al Sweigart al@inventwithpython.com') |