for loop question

bruce bedouglas at earthlink.net
Thu Jul 6 17:26:42 EDT 2006


'ppreaciate the answers!!!!

duh...

-bruce


-----Original Message-----
From: python-list-bounces+bedouglas=earthlink.net at python.org
[mailto:python-list-bounces+bedouglas=earthlink.net at python.org]On Behalf
Of Daniel Haus
Sent: Thursday, July 06, 2006 2:02 PM
To: python-list at python.org
Subject: Re: for loop question


just do:

for a in range(2, foo+1):
    print a

range(a, b) gives [a, a+1, a+2, ..., b-2, b-1]


bruce schrieb:

> hi..
>
> basic foor/loop question..
>
> i can do:
>
>  for a in foo
>   print a
>
> if i want to do something like
>   for a, 2, foo
>     print foo
>
> where go from 2, to foo..
>
> i can't figure out how to accomplish this...
>
> can someone point me to how/where this is demonstrated...
>
> found plenty of google for for/loop.. just not this issue..
> 
> thanks
> 
> -bruce

-- 
http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list