0

Non type object is not callable

#your code goes here def decor(func): def wrap(): print("***") func() print("***") print("END OF PAGE") return wrap @decor def invoice(): print("INVOICE #" + input()) invoice() Why is invoice() a non type object?

30th May 2021, 1:19 PM
Lee 4 Code
Lee 4 Code - avatar
2 ответов
+ 5
Decorator function should return a function. In decor() function your function doesn't return anything as return statement is under wrap() function which was never called. Remove 1 tab from return wrap .
30th May 2021, 1:22 PM
TOLUENE
TOLUENE - avatar
0
Thank you MD Sayed!
30th May 2021, 1:32 PM
Lee 4 Code
Lee 4 Code - avatar