Ad

Swing list sorting:
Examples:

special_sort(list) -> list
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # input
[0, 9, 1, 8, 2, 7, 3, 6, 4, 5] # output
def special_sort(list):
    r = []
    l = len(list)
    for i in range(l // 2 + 1):
    	if i == 0 or (i == l // 2 and not l % 2):
    		r.append(list[i])
    	else: r.extend([list[-i], list[i]])
    return r