Glossary · Phase 0 · Tools
Callback
A function you hand to other code for it to call later, like the key= function given to sorted.
Try it now
Watch rule inside apply_to_all: it holds the function half. Each time the loop calls rule(p), a frame for half appears.
Learn it properly
Functions as values · Store functions, pass them in with key=, and accept any number of arguments. About 35 minutes.
Other terms from the same lesson
- lambda: A small function written on one line without a name, like lambda p: p["price"].
Never trained an AI?
Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.