Python - Sort a list by a certain element in a tuple in a dictionary
For each dict item in the list you want to sort, you want to take the item's value keyed by 'info', which is a list, and sort on the second item (addressed as [1], counting from zero.
So: data.sort(key=lambda item: item['info'][1])
data = [{'info': ('orange', 400000, 'apple'), 'photo': None}, {'info': ('grape', 485000, 'watermelon'), 'photo': None}]
I want to sort data by the 2nd element (400000, 485000) in the tuple in the dictionary.  How do I do this?
I followed another answer and my closest attempt was data.sort(key=lambda tup: tup[1]), but that produces this error:

KeyError: 1