A decorator is a function that modifies the behavior of another function without changing its source code.
defmy_decorator(func):defwrapper():print("Before function execution")func()print("After function execution")return wrapper@my_decoratordefsay_hello():print("Hello")say_hello()
Decorators wrap additional logic around an existing function.