Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.054 X-Spam-Evidence: '*H*': 0.90; '*S*': 0.01; 'else:': 0.03; 'python': 0.11; '"end"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'keyword.': 0.16; 'subject:after': 0.16; 'subject:beginner': 0.16; 'world!")': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'header:In-Reply-To:1': 0.27; 'raise': 0.29; 'tim': 0.29; 'message-id:@mail.gmail.com': 0.30; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; "you're": 0.61; '30,': 0.65; 'subject:day': 0.69; 'subject:First': 0.74; 'lazy': 0.91; 'subject:add': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Oxdjt7PGV2X79Laiy76asGttto9K3Ej0zqyrtz9cUfo=; b=LZnZhlgly1bzcG6H73ulIzG2s1K+ohvYfrySMZE51ZMJI0FfDj5dDp4Zo9OXqbvzlj gJ4Vz/B2iosp/nqdjdviQndRGnojk7hWvQ0bvhoatXHjbFqMJoFcigL3xp1Qd+gjz6z7 Ob/hdQAMUUMAUfourRvauiGFxnFmkV1NiUS8L3RurJpfpD1LK9vF48S4Do+UJ8KdaJNy Viwf80syb7vJz5j7N/tPTz0c1tx7dZ5YOpyw1pNymrEPZ9SBsLnyIr3kppEvaLA1qO0O B+qlb/cIotVFMKt57ElS33ZOrl9kPgtGjNMm6r6Djany+ee0q4dVtyffDhBKLWLxziVu qR5w== MIME-Version: 1.0 X-Received: by 10.68.134.65 with SMTP id pi1mr4390476pbb.59.1383129728913; Wed, 30 Oct 2013 03:42:08 -0700 (PDT) In-Reply-To: <7a457657-7a38-4f68-a33f-820b4629df31@googlegroups.com> References: <4d1c9a55-310b-41b7-8271-435fd095ce70@googlegroups.com> <7e0b17ea-3a79-45e7-aefc-795f3f34af95@googlegroups.com> <20e6a79f-2d0e-4e78-8af6-607375eca676@googlegroups.com> <7a457657-7a38-4f68-a33f-820b4629df31@googlegroups.com> Date: Wed, 30 Oct 2013 21:42:08 +1100 Subject: Re: First day beginner to python, add to counter after nested loop 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383129732 news.xs4all.nl 15863 [2001:888:2000:d::a6]:51807 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58026 On Wed, Oct 30, 2013 at 9:08 PM, wrote: > Well Tim ***one could argue*** why not do a (i think it is called parser) that react to "loop", "end" and "function". And lazy like me do not have to think about "what is not part of program". Python actually does have a symbol for what you're thinking of - but it's not a keyword. Check this out: print("Hello, world!") for i in range(5): #{ print("Line #%d"%i) #} if i>3: #{ print("After the loop, i is huge!") #} else: #{ print("After the loop, something is seriously screwy.") raise RuntimeError #} ChrisA