Hello guys I'm new in python and I'm trying to get the item with the highest kcalorie from a dictionary list but the outout isn't correct can I know what's the problem
maxkcal = int()
kcaldict = { 'udon':300,'salad':150,'gyudon':500,'pasta':450}
print("The menu is:")
for key,value in kcaldict.items():
print(key,value)
maxkcal = max([max(kcaldict.values()) for dict in kcaldict])
print("The food with the highest calorie on the menu is :" ,key, maxkcal,"(Kcal)")
the output is :
The menu is:
udon 300
salad 150
gyudon 500
pasta 450
The food with the highest calorie on the menu is : pasta 500 (Kcal)
but it's supposed to be gyudon 500 not pasta