Skip to content

Instantly share code, notes, and snippets.

@ysnerdem
Last active October 24, 2017 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysnerdem/ae5e711c4352a2c0cd5322152f4e2b6a to your computer and use it in GitHub Desktop.
Save ysnerdem/ae5e711c4352a2c0cd5322152f4e2b6a to your computer and use it in GitHub Desktop.
list = [5,1,4,2,8]
for num in range(len(list)-1,0,-1):
for i in range(num):
if list[i] > list[i+1]:
list[i],list[i+1] = list[i+1],list[i]
print(list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment