Introducing the Guess My Number Game


The program you'll create in this chapter is the classic number guessing game. For those who missed out on this game in their childhood, the game goes like this: the computer chooses a random number between 1 and 100 and the player tries to guess it in as few attempts as possible. Each time the player enters a guess, the computer tells the player whether the guess is too high, too low, or right on the money. Once the player guesses the number, the game is over. Figure 3.1 shows Guess My Number in action.

click to expand
Figure 3.1: Got it in only three guesses! Try to beat that.




Python Programming for the Absolute Beginner
Python Programming for the Absolute Beginner, 3rd Edition
ISBN: 1435455002
EAN: 2147483647
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net