Write a program to sort a dictionarys values using bubble sort and produce the sorted values as a list.
Answers
Answered by
1
Hope this helps you
Attachments:
Answered by
0
Answer:
dic = eval (input("Enter a dictionary : "))
key = list(dic.keys())
for i in range ( len ( key ) - 1 ) :
if key [ i ] > key [ i + 1 ] :
key [ i ] , key [ i + 1 ] = key [ i + 1 ] , key [ i ]
print(key)
Explanation:
Similar questions