+ 1
What is wrong with this python code?
def decor(func): x = "=" return x + func() + x @decor def text(): return "sololearn" print(text())
2 Answers
+ 5
Here is the code: https://code.sololearn.com/cZ3Fkb1T01wP/?ref=app
This might help you about learning decorator and Sololearn also have a great information about Decorators.
In short, make a decor function, then inside it write the function which you wanna edit, by adding parameters or by changing the return value then return the value, and then return your function inside decor function!
https://www.programiz.com/JUMP_LINK__&&__python__&&__JUMP_LINK-programming/decorator
Hope it's helpful!
Happy Learning đđđ»