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


Groups > comp.lang.python > #43298

Re: guessthenumber print games left

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.027
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'that?': 0.05; 'wednesday,': 0.07; 'counting': 0.09; 'run,': 0.09; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'left,': 0.16; 'subject:games': 0.16; 'subtract': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'trying': 0.19; 'thu,': 0.19; 'print': 0.22; "i've": 0.25; 'post': 0.26; 'code:': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'reply.': 0.31; 'us!': 0.31; 'anyone': 0.31; 'figure': 0.32; 'up.': 0.33; 'could': 0.34; "can't": 0.35; 'advice': 0.35; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'thanks': 0.36; 'received:209': 0.37; 'form,': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; "you'll": 0.62; 'show': 0.63; 'skip:n 10': 0.64; 'total': 0.65; 'here': 0.66; 'counts': 0.83; 'subject:skip:g 10': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=MKk+hIWave3EUSBl6Kwqn9mGkYFVkdXF91ZgU0DgW+4=; b=c8FZwZSHVQU1OxeDejXbWngWGssUCLfNKtwyE72aTjlDxMzbMiTjZH3iL7hGdo+4rx r3maoFNihvWUmo/2zUNn6n336+VurNA4aIhm4iGssePeHJmTPWnk9amWStwbfm378Iqy 7RBGTqVD8o+ZxVtMrWRUMbOiYEKMFed0p7AVyXb0lqaqvIKqMq2cw+Hpsznyzjx3z5Hs quGtKkREHblNBA/O+sc+j6uejN8xiAbd7vhfMEVi0YDamX7U0Kb5TopZ28ii3YWLZPAC 8zMcUzIa/vfOR+8zVshZ0VFzk2LD/7vi27nOhd69p14jOk6nR/s90yIfCq7OvyG49ykK LYgg==
MIME-Version 1.0
X-Received by 10.52.97.8 with SMTP id dw8mr2678786vdb.91.1365633079847; Wed, 10 Apr 2013 15:31:19 -0700 (PDT)
In-Reply-To <a183cc9a-9a8b-4bf1-9710-e1e5aafaafe8@googlegroups.com>
References <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com> <mailman.403.1365587062.3114.python-list@python.org> <a183cc9a-9a8b-4bf1-9710-e1e5aafaafe8@googlegroups.com>
Date Thu, 11 Apr 2013 08:31:19 +1000
Subject Re: guessthenumber print games left
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.427.1365633088.3114.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365633088 news.xs4all.nl 2571 [2001:888:2000:d::a6]:47153
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:43298

Show key headers only | View raw


On Thu, Apr 11, 2013 at 7:01 AM,  <eschneider92@comcast.net> wrote:
> 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:
>>
>> 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?
>>
>
> 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.

Set your current code aside, and just make a program that counts games
without actually playing them. Start with this part of your existing
code:

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

That will run, but do nothing. Now add a print call to the loop, and
see if you can work out how to make it count how many games are left.

If you get stuck, post the code for just this program and we'll see
where it takes us!

ChrisA

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