0

why we need return here

def decor(func): def wrap(): print("============") func() print("============") return wrap def print_text(): print("Hello world!") decorated = decor(print_text) decorated() # why we need "return" here?

17th Jun 2020, 9:36 AM
Zhengrong Yan
Zhengrong Yan - avatar
2 Answers
+ 2
Generally , return used to return a particular value to use it in another operation
17th Jun 2020, 9:46 AM
Muhammad Galhoum
Muhammad Galhoum - avatar
+ 2
for calling nested function 😊
17th Jun 2020, 11:25 AM
Shahghasi Adil
Shahghasi Adil - avatar