I want maximum scorer from this complicated data, but it shows error, maybe I am doing something wrong here.
students = {
'harshit':{'score':90, 'age':22},
'Mohit':{'score':79, 'age':20},
'Rohit':{'score':99, 'age':29}
}
print((max(students , key= lambda item: item.get('score'))))
I expected the output : Rohit
but here I got an errorcox they're saying item is a string
but for my case it is also a key