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: 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: References: <0e8b4a09-3d1d-4b92-a0ef-2274a2a651c9@googlegroups.com> Date: Thu, 11 Apr 2013 08:31:19 +1000 Subject: Re: guessthenumber print games left From: Chris Angelico 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Apr 11, 2013 at 7:01 AM, wrote: > On Wednesday, April 10, 2013 5:44:20 AM UTC-4, Chris Angelico wrote: >> On Wed, Apr 10, 2013 at 7:39 PM, 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