l = [{'pri': 1, 'val': '4100'}, {'pri': 2, 'val': '452'}, {'pri': 2, 'val': '283'}]l.sort(key=lambda d: d['pri'])if l[0]['pri'] != l[1]['pri']: print(l[0]['pri'])