sorted_data = sorted(list(data.items()), key=operator.itemgetter(1))
for entry in sorted_data:
    pass
How to sort a dictionary in python by value when the value is a list and I want to sort it by the first index of that list