In Python, a ____ is a function that wraps another function, modifying its behavior.

  • class
  • decorator
  • generator
  • module
In Python, a decorator is a function that wraps another function, allowing you to modify or extend its behavior without changing its source code. Decorators are commonly used for tasks such as adding logging, authentication, or caching to functions.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *