Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75275

Re: complete brain fart, it doesn't loop

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'stops': 0.07; 'snippet': 0.09; 'cc:addr:python-list': 0.11; 'martin': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'loops': 0.16; 'wrote:': 0.18; 'reset': 0.22; 'cc:addr:python.org': 0.22; 'mon,': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'received:google.com': 0.35; 'jul': 0.74; 'to:none': 0.92
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:cc :content-type; bh=AOkIuoKQDe+6NpuLfaZgIoRGZGLRcyjMjkfxyItDWsA=; b=A+ul15nM8xjtP7Mz9Pxk7iyg0aq7ZJ9i6uwrcwKR5Yk4CGiG6yYaZywXr7LseBq0Zb Ya9nkb+dAtO2osCUe1IxLBNG1+DoEbpoBsKNKfXoFvylN1a6hm1pZMGRDK3wbf8Ixavm tyOh/4jsyl+VSe7kAyKckewG+i4UQmjibnqX5Hilkr5abcaJR5PqywfRNkn6gsHRhVPi /ZhjU1Rt7d7mE8vDwS/TRegFrWbdYhloTr2JR+bFxqOYl0hz0P5B4HUhyVLFYb002xPt szZ5Ulx0t4NzB63vWBN7Mrjk6iBkYwfNeLvwmKQykO4gwMnL28lsh/BqFy0ZxFdgYnuu MMag==
MIME-Version 1.0
X-Received by 10.42.15.19 with SMTP id j19mr35985784ica.59.1406483713497; Sun, 27 Jul 2014 10:55:13 -0700 (PDT)
In-Reply-To <CAHXoDSB=W3S4gwc7aJO2AA6gtkz5VGQ5=y7hZ5tLL32AamjmXQ@mail.gmail.com>
References <CAHXoDSB=W3S4gwc7aJO2AA6gtkz5VGQ5=y7hZ5tLL32AamjmXQ@mail.gmail.com>
Date Mon, 28 Jul 2014 03:55:13 +1000
Subject Re: complete brain fart, it doesn't loop
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12361.1406483721.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406483721 news.xs4all.nl 2910 [2001:888:2000:d::a6]:52771
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75275

Show key headers only | View raw


On Mon, Jul 28, 2014 at 3:53 AM, Martin S <shieldfire@gmail.com> wrote:
> I have this snippet in my web application. Question is why doesn't the
> stupid thing loop ten times? It loops exactly 1 time.
>
>   # Reset counter
>     counter = 0
>
>     while counter <= 10:
>
>         return "<p>Long line with games</p>"
>
>         counter=counter+1

When you hit the 'return', it stops the function immediately :)

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: complete brain fart, it doesn't loop Chris Angelico <rosuav@gmail.com> - 2014-07-28 03:55 +1000

csiph-web