Skip to content

Instantly share code, notes, and snippets.

@nathantowell
Created July 31, 2016 17:30
Show Gist options
  • Save nathantowell/babb41e29aec039f33711fd44f95cf37 to your computer and use it in GitHub Desktop.
Save nathantowell/babb41e29aec039f33711fd44f95cf37 to your computer and use it in GitHub Desktop.
A simple function to order a list.
def max_of(list):
for a in reversed(range(1, len(list)+1)):
for b in range(1, a):
if list[b-1] > list[b]:
temp = list[b-1]
list[b-1] = list[b]
list[b] = temp
return list
#Example
print(max_of([5,9,12,7,4,5,15,75]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment