Class dictionary built-in của Python có phương thức keys() trả về list tất cả key trong mỗi cặp key-value. Hàm built-in max() cho key lớn nhất từ list.
>>> dct = {1: 45, 2: 76, 3: 12, 4: 55, 5: 33}
>>> klist = dct.keys()
>>> klist
dict_keys([1, 2, 3, 4, 5])
>>> max(klist)
5