loop iterators?

Tim Chase python.list at tim.thechases.com
Tue Oct 17 13:17:52 EDT 2006


> l = ['a','b','c']
> for e in l:
>    print l, i
>    i = i + 1
> 
> Is there a way to get rid of the i processing in this script?
> Sorry I'm still trying to learn python tricks here...


for i, e in enumerate(l):
	print l, i

-tkc






More information about the Python-list mailing list