How to sort values in dictionary with Python

1 Answer

0 votes
language = {'python': 13, 'php': 50, 'java': 6, 'c++': 2}
 
values = sorted(language.values())

print(values)


'''
run:
 
[2, 6, 13, 50]
 
'''

 



answered Aug 28, 2018 by avibootz

Related questions

3 answers 339 views
1 answer 301 views
1 answer 275 views
1 answer 230 views
2 answers 311 views
1 answer 258 views
...