# DEEP DIVE: Python Decorators (Intermediate to Advanced) def greet(name): return f"Hello, {name}"
multiply(4, 7) from functools import wraps # DEEP DIVE: Python Decorators (Intermediate to Advanced)
add = logger(add) # manual decoration print(add(3, 5)) @logger def multiply(a, b): return a * b 5)) @logger def multiply(a
say = greet # assign function to variable print(say("Alice")) # Hello, Alice def outer(msg): def inner(): # closure captures 'msg' print(msg) return inner # DEEP DIVE: Python Decorators (Intermediate to Advanced)