+ 3
Anyone please send me link of best and simple Python decoration explanation
3 odpowiedzi
+ 9
I once wrote a simple, example code with two decorators. Basically, decorators modify the normal execution of a method and alter its behavior, by using it as an argument in another method.
Check it out:
https://code.sololearn.com/cn8ZQJ689rWX/?ref=app
+ 3
def decor(func):
def wrap():
print("============")
func()
print("============")
return wrap
@decor
def print_text():
print("Hello I'm Rishita..!")
print_text();
0
Decorators is a way to modify functions using other functions.