How to sort dictionary according to its values in python?
Answers
Answered by
0
Description: The method values() returns a list of all the values available in a given dictionary.
The Python Code is:
Input:
dict = {'Sex': 'female', 'Age': 7, 'Name': 'Zara'}
print ("Values : ", list(dict.values()))
Output:
Values : ['female', 7, 'Zara']
If you have Some more questions, then contact me at:
Email: [email protected]
Youtube: shorturl.at/mnB57
Similar questions