Skip to main content

Program to demonstrate Decorators in Python

· One min read
Kaustubh Kulkarni

Que > Program to demonstrate Decorators in Python

file.py
def first(msg):
print(msg)
def second(func, msg):
func(msg)
second(first, "Hello!")
Output
Hello!