Sorting with key and lambda
sorted() takes a key, a function it calls on each item to get the value to compare, so a short lambda can sort recipes by their minutes or a dictionary's entries by their values, from largest to smallest with reverse=True.
Updated

- Category
- Python
- Level
- Journeyman
- Tags
- Lambda Function, python, Sort Key (data-structures), sorted()