python-cookbook icon indicating copy to clipboard operation
python-cookbook copied to clipboard

Use 'key' kwarg in min/max/sorted when calculating with dicts

Open claudejrogers opened this issue 12 years ago • 0 comments

Instead of zipping the values and keys of a dictionary to sort or find the min/max, why not use the 'key' kwarg of those functions along with dict.items()?

claudejrogers avatar Aug 25 '13 00:08 claudejrogers