guessthenumber print games left

Chris Angelico rosuav at gmail.com
Wed Apr 10 05:44:20 EDT 2013


On Wed, Apr 10, 2013 at 7:39 PM,  <eschneider92 at comcast.net> wrote:
> Could anyone tell me how to make the program tell me how many games are left before the first game and second game? For example, after one game of guess the number, I want it to tell me that i get one more game. P.S. I'm totally new to python (obviously), and I just added numberofgames variable in hopes of solving this problem. am I on the right track? Thanks for any assistance!

> numberofgames=1
> while numberofgames<4:
>     numberofgames=numberofgames+2

First off, why are you adding two? Is this a typo?

You have here a counter, but it's counting up. To figure out how many
games are left, just subtract the numberofgames from the total number
of games that you'll be allowing - that's how many there are left. Do
you know how to do that?

ChrisA



More information about the Python-list mailing list