On Tue, 21 Apr 2009 21:06:46 -0400, Esmail wrote:

> Given a list 'li', I can always do this to iterate through all items in
> order:
> 
> for i in range(0, len(li)):
>      print li[i]
> 
> Will this always be equivalent to
> 
> for i in li:
>      print i

For lists, yes, that will always be equivalent, and the second one is 
considered more Pythonic.



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

Reply via email to