Skip to content

Instantly share code, notes, and snippets.

@kharioki
Created October 13, 2016 20:25
Show Gist options
  • Save kharioki/59e5571c3ac788c635a9cfc9f763c148 to your computer and use it in GitHub Desktop.
Save kharioki/59e5571c3ac788c635a9cfc9f763c148 to your computer and use it in GitHub Desktop.
def sort_special(a):
new_a = []
while len(a) > 1:
new_a.append(min(a))
a.remove(min(a))
new_a.append(max(a))
a.remove(max(a))
return new_a
a = [54,26,93,17,77,31,44,55,20]
print(sort_special(a))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment