Thursday, March 26, 2009

Python notes, halving list

Splitting list from the middle:
>>> a = [34,412,3,2,4,6,78,9,2]
>>> [a.pop(0) for alk in a]
[34, 412, 3, 2, 4]
... tricky ain't it.

No comments: