Sort dict by key and retrieve value
Another approach would be to create a generator object yielding the values of the dict,
cast them to a list and then print it.
print(list(val for val in scores.values()))
Given scores = { 0.0: "bob", 5.2: "alex", 2.8: "carl"}
To get the output [ "bob", "carl", "alex" ]
I can do print([ scores[key] for key in sorted(scores.keys()) ])
Is this the best (most "pythonic") way? I was thinking I could use scores.items() in conjunction with sorted(key=...) to avoid the dictionary lookup, but not sure what that key parameter would be.