Given a list
a = [0,1,2,3,4,5,6,7,8,9]
how can I get
b = [0,9,1,8,2,7,3,6,4,5]
That is, produce a new lis
One way to do this for even-sized lists (inspired by this post):
a = range(10) b = [val for pair in zip(a[:5], a[5:][::-1]) for val in pair]