python-cookbook
python-cookbook copied to clipboard
Use 'key' kwarg in min/max/sorted when calculating with dicts
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()?