Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'else:': 0.03; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; 'received:gator410.hostgator.com': 0.09; '~ethan~': 0.09; 'pm,': 0.10; 'broken': 0.14; 'wrote:': 0.14; '"))': 0.16; 'hudson': 0.16; 'received:gateway13.websitewelcome.com': 0.16; 'subject:Objects': 0.16; 'subject:PLEASE': 0.16; 'cc:addr:python-list': 0.17; 'header :In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'fine': 0.22; 'cc:no real name:2**0': 0.23; 'subject:HELP': 0.29; 'cc:addr:python.org': 0.30; 'does': 0.33; 'break': 0.33; 'belong': 0.34; 'header:User- Agent:1': 0.35; 'else': 0.35; 'but': 0.38; 'subject:: ': 0.38; 'subject:, ': 0.60; 'received:websitewelcome.com': 0.67; 'received:69.56': 0.77; 'to:addr:yahoo.com': 0.80; 'off!': 0.84; 'subject:Methods': 0.84 Date: Thu, 09 Jun 2011 05:54:56 -0700 From: Ethan Furman User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Larry Hudson Subject: Re: Of Functions, Objects, and Methods-I NEED HELP PLEASE References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator410.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: c-67-170-168-84.hsd1.or.comcast.net ([192.168.74.5]) [67.170.168.84]:3090 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 1 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3I0MTAuaG9zdGdhdG9yLmNvbQ== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 43 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307624146 news.xs4all.nl 49179 [::ffff:82.94.164.166]:33395 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7295 Larry Hudson wrote: > On 06/08/2011 01:09 PM, Cathy James wrote: >> Dog Breed: ")) >> while not dogs: >> print("Goodbye!!") >> sys.exit() >> else: > > else does not belong with while. else works just fine with while; it is the path taken when the while is exhausted, but not broken out of: --> i = 5 --> while i: ... print(i) ... i -= 1 ... else: ... print("blast off!") ... 5 4 3 2 1 blast off! --> i = 5 --> while i: ... print(i) ... i -= 1 ... if i == 3: ... print('aborting') ... break ... else: ... print("blast off!") ... 5 4 aborting ~Ethan~