Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'programmer': 0.03; 'anyway.': 0.05; 'output': 0.05; 'string': 0.09; 'strings.': 0.09; 'structure,': 0.09; 'subtle': 0.09; 'python': 0.11; 'bugs.': 0.16; 'formatting,': 0.16; 'indent': 0.16; 'recipe': 0.16; 'subject:after': 0.16; 'subject:beginner': 0.16; 'subject:python': 0.16; 'language': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; 'example': 0.22; 'programming': 0.22; 'print': 0.22; 'creating': 0.23; 'header :User-Agent:1': 0.23; "aren't": 0.24; 'fine': 0.24; 'header:In- Reply-To:1': 0.27; 'to:2**1': 0.27; 'quickly': 0.29; 'to:no real name:2**1': 0.29; 'statement': 0.30; 'program,': 0.31; 'code': 0.31; 'terms.': 0.31; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'really': 0.36; 'method': 0.36; 'two': 0.37; 'easily': 0.37; 'implement': 0.38; 'writes': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'space': 0.40; 'simple,': 0.60; 'new': 0.61; "you're": 0.61; 'email addr:gmail.com': 0.63; 'different': 0.65; 'pays': 0.65; 'to:addr:gmail.com': 0.65; 'channels': 0.68; 'subject:day': 0.69; 'information:': 0.72; 'subject:First': 0.74; 'attention': 0.75; 'subject:add': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=6D834xRv47skgcSQpSriObqh6UYfSdDivyZFJytyWf4=; b=BJPcKbDu+caBzHNTLkV4XUV4EtD3TQll+K2xy7cMp7r8r8HJyG/6eR7X6ZRJM2Fx+9 I0ddN0uQUwcGWMtmlkwv3zdkVCJ3R0dcUZn8svz+lB4UBCH6TbNCw47rphaoR94Hm9TI vF+zZM1IlRtojy1Kw0yt6EhDx/KFvITD3HCIjIFOyzgCF9Vv3ls/GYwUt7lvi6u+gA5R RnTeWEyGIX5ZoENGrjZlv1hOZUU3XZajDEe58W8/nwzKzKorvCsmAd/dCkwsdr+pYhMC K3iikkbm+smzjAaKEM2EKVvQXiGOi8dsySb5xOdPp/1ZBg5UZpT8oO43dt17z8EbxujA 7WNg== X-Received: by 10.58.182.166 with SMTP id ef6mr74570vec.58.1383078634844; Tue, 29 Oct 2013 13:30:34 -0700 (PDT) Sender: Ned Batchelder Date: Tue, 29 Oct 2013 16:30:33 -0400 From: Ned Batchelder User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: jonas.thornvall@gmail.com, python-list@python.org Subject: Re: First day beginner to python, add to counter after nested loop References: <4d1c9a55-310b-41b7-8271-435fd095ce70@googlegroups.com> <7e0b17ea-3a79-45e7-aefc-795f3f34af95@googlegroups.com> <20e6a79f-2d0e-4e78-8af6-607375eca676@googlegroups.com> In-Reply-To: <20e6a79f-2d0e-4e78-8af6-607375eca676@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383078644 news.xs4all.nl 15932 [2001:888:2000:d::a6]:34642 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:57971 On 10/29/13 4:08 PM, jonas.thornvall@gmail.com wrote: > Why did Python not implement end... The end is really not necessary for the programming language it can be excluded, but it is a courtesy to the programmer and could easily be transformed to indents automaticly, that is removed before the compiliation/interpretation of code. If you're going to indent your code correctly anyway, then the "end"s are just extra noise. And if you aren't going to indent your code to match the structure, then you have two different channels of information: the human pays attention to the indentation, and the computer pays attention to the ends. That's a recipe for creating lots of subtle bugs. You get used to reading the indentation. > They could had used print and prinln from basic? I do not want new line everytime i write out some terms. And i do not like it add extra space after each print of variable print(factor,"^2") writes out 12 ^2 and i do not think there is any space after the factor? > The print statement is very simple, and has not had a lot of features added to it, because you very quickly outgrow it anyway. If you want fine control over the output of your program, you use string formatting, for example with the .format() method on strings. --Ned.