Created
April 28, 2020 08:58
-
-
Save computer-tutor/a7bd6852668d9736799c189883cc7645 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
def bubble_sort(k): | |
for i in range(1,len(k)): | |
for j in range (len(k)-1): | |
if k[j]>k[j+1]: | |
k[j],k[j+1]=k[j+1],k[j] | |
return k | |
dict = {'c':1,'f':22,'a':13,'d':4,'e':5,'h':8} | |
k=list(dict.values()) | |
print(bubble_sort(k)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment