Exercises
Now that you know how to use some of the functional programming features in Python, perhaps you can try writing the quicksort algorithm as (a collection of) regular functions instead of the hard-to-read Y-combinator version.
You can also try and write a groupby
function yourself that isn’t affected by sorting and returns lists of results that can be used multiple times rather than just once.
Example answers for these exercises can be found on GitHub: https://github.com/mastering-python/exercises. You are encouraged to submit your own solutions and learn about alternative solutions from others.