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.
Loading...
Related Quiz
- How would you handle collisions in a hash table?
- Which Matplotlib function allows plotting data points in the form of a two-dimensional density plot?
- How would you implement a dequeue (double-ended queue) data structure?
- How would you implement rate limiting in a RESTful API to prevent abuse?
- The algorithm that follows the 'divide and conquer' strategy is ____.