A function can be defined inside another function, and an inner function can remember the variables of the function that made it, even after that function has finished. That memory is called a closure. It is how Python gives a function its own private state without a class, and it is the idea behind decorators, which you will meet in Module 15.
More lessons in Complete Python Programming