is there a better way?

Schüle Daniel uval at rz.uni-karlsruhe.de
Fri Feb 10 19:37:59 EST 2006


Lonnie Princehouse wrote:
> everybody is making this way more complicated than it needs to be.
> 
> storage = list[:list.index(O)]

the question is whether the old list is needed in the future or not
if not then it would be easer/mor efficient to use

del lst[lst.index(0):]

Regards, Daniel




More information about the Python-list mailing list