Q. Write a Python program to find the highest 3 values in a dictionary.
Answer =
dic = eval(input("Enter a dictionary :-")) val = list( dic.values() ) val.sort() print("Highest 3 values ",val[ - 1 : - 4 : - 1])
Output :-
Enter a dictionary :-{ "Portal":16, "Express":14, "Path":15, "Walla":10,"Python":19}
Highest 3 values [19, 16, 15]
>>>
Nothing is helping. please update with a more relevant code. can't get it through
ReplyDeleteCode is correct please try to understand by Output.
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )