How to Sort ascending list of dictionary python

  python

I have list like this

list1 = [
    {'entity': 'A', 'index:': 0},
    {'entity': 'B', 'index:': 4},
    {'entity': 'Aa', 'index:': 9},
    {'entity': 'D', 'index:': 10},
    {'entity': 'z', 'index:': 2},
]

I want to sort this List using index inside the dict

Source: Python Questions

LEAVE A COMMENT