Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed1.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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'finished.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'buggy': 0.16; 'finnish': 0.16; 'indent': 0.16; 'loop.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:after': 0.16; 'subject:beginner': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'finished': 0.19; 'header:User-Agent:1': 0.23; 'right.': 0.26; 'header:X-Complaints-To:1': 0.27; 'specified': 0.30; 'indentation': 0.31; 'maybe': 0.34; 'problem': 0.35; 'hundreds': 0.35; 'charset:us-ascii': 0.36; 'starting': 0.37; 'to:addr:python-list': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'till': 0.61; 'simple': 0.61; 'reach': 0.63; 'email addr:gmail.com': 0.63; 'choose': 0.64; 'more': 0.64; 'subject:day': 0.69; 'subject:First': 0.74; 'subject:add': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: Re: First day beginner to python, add to counter after nested loop Date: Tue, 29 Oct 2013 19:24:57 +0000 (UTC) References: <4d1c9a55-310b-41b7-8271-435fd095ce70@googlegroups.com> <7e0b17ea-3a79-45e7-aefc-795f3f34af95@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-108-32-186-211.hstntx.dsl-w.verizon.net User-Agent: XPN/1.2.6 (Street Spirit ; Linux) 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: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383074721 news.xs4all.nl 15930 [2001:888:2000:d::a6]:56602 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57962 On 29/10/2013 14:35, jonas.thornvall@gmail.com wrote: (Deleting hundreds of quad-spaced garbage. Please be more considerate of others if you choose to use buggy googlegroups, maybe starting by studying: ) Please indent by 4 columns, not 1. Since indentation is how scope is specified in Python, it's very important to get it right. > i do not understand howto reach outer loop after finnish inner loop, in fact i do not understand when finished. The inner loop is finished whenever you stop indenting by 8 columns. If you have a fundamental problem like this, keep it simple till you understand it: q = 12 for x in range(10): for y in range(3): q = 3*q + 1 print("inner", q) print("outer", x*q) print("done") Because of the detenting, the print("outer", x*q) is in the outer loop. -- DaveA