for loop question

Grant Edwards grante at visi.com
Thu Jul 6 17:41:38 EDT 2006


On 2006-07-06, Daniel Haus <daniel.haus at gmail.com> wrote:

>> 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..

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

Except that in the OP's example foo was a sequence, not an
integer.  I think.

-- 
Grant Edwards                   grante             Yow!  You can't hurt
                                  at               me!! I have an ASSUMABLE
                               visi.com            MORTGAGE!!



More information about the Python-list mailing list