Feb-28-2021, 10:33 PM
To find highest and lowest, sort them.
x = {'001':['Grex','22','40'], '002':['C-Paul','02' ,'88'], '003':['Aquille','11','76']} print('By Name', dict(sorted(x.items(), key=lambda item: item[1]))) print('By Personality', dict(sorted(x.items(), key=lambda item: item[1][1]))) print('By Ability', dict(sorted(x.items(), key=lambda item: item[1][2])))As for efficient access, maybe you want to create 2 dictionaries. One keyed by ID ('001?) and another by name.