Skip to main content

Functions

PhD in Python Functions

From kindergarten to PhD, this may be the most comprehensive chapter on Python functions. We start with the basics of defining and calling functions, learn how to write them well, then learn closures, decorators, recursion, and generators, all the way to theory of computation and how CPython executes functions under the hood.