10. Write a python program to list out the maximum and minimum value from a Python dictionary, list_a as a Python list showed in the following output.
The output is:
dict_a = {'Python user': 2357, 'R-Programming user':1988, 'Java user':597,
'C Programming user':5670}
Expected Answer:
The maximum value is: 5670
The minimum value is: 597
Sample Answer:
dict_a = {'Python user': 2357, 'R-Programming user':1988, 'Java user':597, 'C Programming user':5670} maximum = max(dict_a.keys(), key=(lambda k: dict_a[k])) minimum = min(dict_a.keys(), key=(lambda k: dict_a[k])) print('The maximum value is: ',dict_a[maximum]) print('The minimum value is: ',dict_a[minimum])
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)