In <[EMAIL PROTECTED]>, SpreadTooThin
wrote:

> Hi I need to get a for loop to give me an element from a list and an
> index number...
> for example:
> 
> i = 0
> 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?

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

Ciao,
        Marc 'BlackJack' Rintsch

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

Reply via email to