Non type object is not callable | Sololearn: Learn to code for FREE!


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?

5/30/2021 1:19:24 PM

Lee 4 Code

2 Answers

New Answer


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 .


Thank you MD Sayed!