Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!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.045 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'messages.': 0.05; 'lawrence': 0.09; 'tismer': 0.09; 'python': 0.11; 'def': 0.12; '(1,': 0.16; 'exponent': 0.16; 'function?': 0.16; 'quoted': 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.22; 'programming': 0.22; 'import': 0.22; 'header :User-Agent:1': 0.23; 'oktober': 0.24; 'math': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'to:2**1': 0.27; 'function': 0.29; 'am,': 0.29; 'to:no real name:2**1': 0.29; 'easier': 0.31; 'factor': 0.31; 'skip:# 10': 0.33; 'received:209.85': 0.35; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; "he's": 0.36; 'should': 0.36; 'received:209': 0.37; 'christian': 0.38; 'to:addr:python-list': 0.38; 'extremely': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'remove': 0.60; 'read': 0.60; 'numbers': 0.61; 'range': 0.61; 'world.': 0.61; 'email addr:gmail.com': 0.63; 'more': 0.64; 'talking': 0.65; 'to:addr:gmail.com': 0.65; 'number:': 0.66; 'here': 0.66; 'subject:day': 0.69; 'square': 0.74; 'subject:First': 0.74; 'subject:add': 0.91; '2013': 0.98 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=UgRlTuafUaelzV/3Aqdonpm+RfN8YagYt3teZUGXLek=; b=yy0RiF0kPW+eOINK7H22sXfwVrU8px4BHanEeHwvq3LHNI+fEIjiqnccyLDHqd+0wR gGml22HVvpgveOd3YnBNmNBeyDu4UEPo1XElz0rAhyjNE3Q3f2gDVsFejiJIYMPhEdxP S263QZ2W5KOIXIoNiCFOANYGXVqqALGpMdlQW8Aty2K3PWw/5KQjJp/EUDnARET+uTgo VopFhc7Te5d6aJfHmlS2e71d+iIWra0WqV8qEvlLxZdhRx8ddec5MmLKQ2PdDjY316r4 QMM7QiCYioWUTkFLgNYMnY6pU8Q5IQHr+mIQnUrZwpgDtjcFCsWnLqVauFfTVtKQSkcK 3U2w== X-Received: by 10.236.191.72 with SMTP id f48mr3425695yhn.32.1383137486636; Wed, 30 Oct 2013 05:51:26 -0700 (PDT) Sender: Ned Batchelder Date: Wed, 30 Oct 2013 08:51:25 -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> <56e77d03-45cc-49d6-a951-ee1cab3fca4d@googlegroups.com> <7c730b3e-66ad-4835-9190-7483d7a75110@googlegroups.com> <5a399d24-dcfa-4e6a-a0d2-31f748729852@googlegroups.com> In-Reply-To: <5a399d24-dcfa-4e6a-a0d2-31f748729852@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: 62 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383137503 news.xs4all.nl 15972 [2001:888:2000:d::a6]:51866 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58032 On 10/30/13 6:13 AM, jonas.thornvall@gmail.com wrote: > Den onsdagen den 30:e oktober 2013 kl. 11:00:30 UTC+1 skrev Mark Lawrence: >> On 30/10/2013 09:52, jonas.thornvall@gmail.com wrote: >> >> >> >> Please stop sending us double spaced crap. >> >> >> >> -- >> >> Python is the second best programming language in the world. >> >> But the best has yet to be invented. Christian Tismer >> >> >> >> Mark Lawrence > I am not sure what you want. > You want me to remove the empty line in function? I do it for it is easier to read for me. Jonas, he's talking about the quoted content that Google Groups includes in your messages. Some people find this extremely aggravating. As for your code, you should actually give it much more space: #!/usr/bin/env python import math # Function definition is here def sq(number): square = 1 factor = 2 multip = exponent * exponent # not sure why exponent is accessed globally.. print(x, "= ", end="") while number >= multip: while square <= number: factor += 1 square = factor * factor factor -= 1 print(factor, "^", exponent, "+", sep="", end="") number -= factor*factor square = 1 factor = 1 print(number) # Set exponent here exponent = 3 print("Exp=x^", exponent, sep="") # Set range of numbers x for x in range (1, 100): sq(x) --Ned.