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


Groups > comp.lang.python > #75275 > unrolled thread

Re: complete brain fart, it doesn't loop

Started byChris Angelico <rosuav@gmail.com>
First post2014-07-28 03:55 +1000
Last post2014-07-28 03:55 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#75275 — Re: complete brain fart, it doesn't loop

FromChris Angelico <rosuav@gmail.com>
Date2014-07-28 03:55 +1000
SubjectRe: complete brain fart, it doesn't loop
Message-ID<mailman.12361.1406483721.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web