Intermediate Python
Q44 / 101

What is a decorator in Python?

Correct! Well done.

Incorrect.

The correct answer is B) A function that wraps another function to modify or extend its behavior

B

Correct Answer

A function that wraps another function to modify or extend its behavior

Explanation

Decorators (using @syntax) are higher-order functions that take a function and return a modified version. Common uses: logging, caching, access control.

Progress
44/101