Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'from:addr:yahoo.co.uk': 0.04; 'yet.': 0.04; 'tries': 0.07; 'exercising': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:while': 0.09; 'python': 0.11; 'guess.': 0.16; 'incremented': 0.16; 'key?': 0.16; 'parentheses': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:program': 0.16; 'superfluous': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'code.': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'conjunction': 0.24; 'url:moin': 0.24; 'initial': 0.24; 'regardless': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'url:wiki': 0.31; 'initialized': 0.31; 'writes:': 0.31; 'quite': 0.32; 'url:python': 0.33; 'guess': 0.33; 'could': 0.34; "i'll": 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'days': 0.60; 'read': 0.60; 'reaching': 0.61; 'lost': 0.61; 'john': 0.61; "you're": 0.61; 'charset:windows-1252': 0.65; 'enjoy': 0.71; 'subject:First': 0.74; 'game,': 0.84; 'received:2': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: First python program, syntax error in while loop Date: Mon, 06 May 2013 13:37:48 +0100 References: <24c5856e-a30a-41bd-aa4a-0e594734e1f8@googlegroups.com> <163bd508-f225-4b4d-8173-1e070c5d5aad@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-2-98-196-142.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 In-Reply-To: X-Antivirus: avast! (VPS 130506-0, 06/05/2013), Outbound message X-Antivirus-Status: Clean 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: 29 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1367843880 news.xs4all.nl 15889 [2001:888:2000:d::a6]:59579 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44826 On 06/05/2013 13:06, Neil Cerutti wrote: > On 2013-05-03, John Gordon wrote: >> In Neil Cerutti writes: >> >>> Not quite yet. Players who guess correctly on the fifth try don't >>> get credit. >> >> Are you sure? tries is initialized to zero and isn't >> incremented for the initial guess. > > while (number != guess) and (tries < 5): > > Is the condition that concludes the game. > > After the game, you are told you lost if tries is not less than > five, regardless of if number == guess. > One of these days I'll work out why some people insist on using superfluous parentheses in Python code. Could it be that they enjoy exercising their fingers by reaching for the shift key in conjunction with the 9 or 0 key? -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence