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
mylist = [0,1,2,3,4,5,6,7,8,9] result = [] for i in mylist: result += [i, mylist.pop()]
Note:
Beware: Just like @Tadhg McDonald-Jensen has said (see the comment below) it'll destroy half of original list object.