enhancing slicing

Markus Schaber markus at schabi.de
Mon Aug 27 23:58:13 CEST 2001


Chris Barker <chrishbarker at home.net> schrub:

>>>> [l[i] for i in range(len(l)) if (i in indexes)]

Why not [l[i] for i in indexes] ?

"The strength of the Constitution lies entirely in the determination of 
each citizen to defend it. Only if every single citizen feels duty 
bound to do his share in this defense are the constitutional rights 
secure." -- Albert Einstein

More information about the Python-list mailing list