In Python a function is an ordinary value, like a number or a list. You can store it, pass it to another function, return it and put it in a dictionary. Once you see that, a lot of Python falls into place: sorted with a key, callbacks, dispatch tables and decorators are all this one idea. This lesson also shows how to join functions into a chain and how to fix some of a function’s arguments in advance.
More lessons in Complete Python Programming