What are first-class functions and closures?
Model answer
Functions are objects: you can store them, pass them as arguments and return them. A closure is an inner function that remembers variables from the enclosing function after it has returned. They are the base for decorators and function factories.
Learn this topic
Functions in Python: def, Arguments and return in the course Python for Beginners: Learn to Code with Real Projects.
Sign in to add your own answer.