Created
April 28, 2020 08:58
-
-
Save computer-tutor/35cf9ae0079aa83eb0336bbcb557bb61 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.keys()) | |
print(bubble_sort(k)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment