list of indices

Tim Chase python.list at tim.thechases.com
Mon Jul 24 11:31:59 EDT 2006


>>    indices=[0,3,6]
>>    new_list=list[indices]
>     new_list = [list[x] for x in indicies]

and just as a caveat, it's generally considered bad form to 
shadow the built-in list as such...

-tkc







More information about the Python-list mailing list