sort values and return list of keys from dict python [duplicate] April 28, 2023 by Tarik Use sorted with the get method as a key (dictionary keys can be accessed by iterating): sorted(A, key=A.get)