[Tutor] Looping

W W srilyk at gmail.com
Mon Apr 20 16:52:18 CEST 2009


On Mon, Apr 20, 2009 at 8:48 AM, Matt
<HellZFury+Python at gmail.com<HellZFury%2BPython at gmail.com>
> wrote:

> Hey everyone,
>
> First post to this list. I hope I'm doing it right.
>
> Let's say I want to run func 10 times Is there a more pythonic way to do it
> than this:
> for i in xrange(10):
>  func()


AFAIK that's the most pythonic way to do it... and probably how I'd do it...
if I had a function I needed to run 10 times :P

-Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090420/ee65dea7/attachment.htm>


More information about the Tutor mailing list