Computer Science, asked by Abhishekavarma3412, 1 year ago

How to sort dictionary according to its values in python?

Answers

Answered by CoolBro003
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