Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43292

Re: guessthenumber print games left

Newsgroups comp.lang.python
Date 2013-04-10 14:01 -0700
References <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com> <mailman.403.1365587062.3114.python-list@python.org>
Subject Re: guessthenumber print games left
From eschneider92@comcast.net
Message-ID <mailman.424.1365627722.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote:
> On Wed, Apr 10, 2013 at 7:39 PM,  <eschneider92@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

Thanks for the quick reply. I've been trying your advice but I can't figure it out. If anyone could show me how to do it in program form, it would be much obliged.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

guessthenumber print games left eschneider92@comcast.net - 2013-04-10 02:39 -0700
  Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-10 19:44 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
      Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 08:31 +1000
    Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 14:01 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:34 -0700
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:41 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 15:48 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 22:56 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:02 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-10 23:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 16:27 +1000
  Re: guessthenumber print games left eschneider92@comcast.net - 2013-04-11 00:15 -0700
    Re: guessthenumber print games left Chris Angelico <rosuav@gmail.com> - 2013-04-11 17:27 +1000
    Re: guessthenumber print games left Neil Cerutti <neilc@norwich.edu> - 2013-04-11 12:31 +0000

csiph-web