Skip to content

Instantly share code, notes, and snippets.

@computer-tutor
Created April 28, 2020 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save computer-tutor/a7bd6852668d9736799c189883cc7645 to your computer and use it in GitHub Desktop.
Save computer-tutor/a7bd6852668d9736799c189883cc7645 to your computer and use it in GitHub Desktop.
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