6 ms·
In [1]: breakfast = {"bacon": 2, "eggs": 3} In [2]: sorted(breakfast) Out[2]: ['bacon', 'eggs'] Done. One and only one obvious way to return a sorted list of
by kortex 9y ago
In [1]: breakfast = {"bacon": 2, "eggs": 3}
In [2]: sorted(breakfast)
Out[2]: ['bacon', 'eggs']
Done. One and only one obvious way to return a sorted list of keys of a dict.