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:
![](https://hi-static.z-dn.net/files/d0f/25f048cf6a3b8fd91888f3c7ba9dd790.png)
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