simple question re list iteration semantics
ebonak at hotmail.com
Wed Apr 22 03:06:46 CEST 2009
I have a simple question regarding semantics.
Given a list 'li', I can always do this to iterate through all items in
for i in range(0, len(li)):
Will this always be equivalent to
for i in li:
I assume it is, and the order will always be the same, or am I mistaken?
Would the 2nd one be considered more Pythonic? (It looks both
clearer and cleaner to me).
More information about the Python-list