Сортировка кортежей
sorted_by_second = sorted(data, key=lambda tup: tup[1])
Horrible Hoopoe
sorted_by_second = sorted(data, key=lambda tup: tup[1])