Skip to content

Instantly share code, notes, and snippets.

@itzbernoulli
Created October 13, 2016 22:55
Show Gist options
  • Save itzbernoulli/780d6d00deeb4240d439cf310eaaeaa7 to your computer and use it in GitHub Desktop.
Save itzbernoulli/780d6d00deeb4240d439cf310eaaeaa7 to your computer and use it in GitHub Desktop.
Another class activity
arr = [1,4,5,6,7,3,2]
#This is a program that creates an alternate sort for an array
def alternate_sort(arr):
f = sorted(arr)
d = []
for i in range(1,(len(arr)/2)+1):
d.append(f[i-1])
d.append(f[-i])
return d
print alternate_sort(arr)
Eric Ondenyi (Kenya)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment