Last active
October 24, 2017 23:05
-
-
Save ysnerdem/ae5e711c4352a2c0cd5322152f4e2b6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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