What are decorators in python?
Python has many interesting features one of them are decorators. Decorators are used to define a function inside a function.
It is used to add some functionality in a function and then return it.
e.g.,
def demo(num): print(num) demo("25") demo=deco deco("25")
output- 25 25
This is how we use decorator in python.
Subscribe
Login
Please login to comment
0 Discussion