[Python-il] elegant non contiguous slice

Avishalom Shalit avishalom at gmail.com
Thu Dec 30 00:11:01 IST 2010

Is there a way to elegantly take the (e.g. ) 2nd 7th and 10th element in a list

more elegant than
[arr[x] for x in [1,6,9] ]

along the lines of

not a big issue, but i am curious

-- vish

More information about the Python-il mailing list