Iterate from 2nd element of a huge list

duncan smith buzzard at
Tue Jan 31 21:31:33 EST 2012

On 01/02/12 01:39, Paulo da Silva wrote:
> Hi!
> What is the best way to iterate thru a huge list having the 1st element
> a different process? I.e.:
> process1(mylist[0])
> for el in mylist[1:]:
> 	process2(el)
> This way mylist is almost duplicated, isn't it?
> Thanks.

Maybe (untested),

it = iter(mylist)
for el in it:


More information about the Python-list mailing list