0
Please what is wrong with my Decorator code?
def decor(func): def w(): print("***") func() print("***") print ("END OF PAGE") return w @decor def invoice(num): print("INVOICE #" +num) invoice(input())
1 Odpowiedź
+ 1
Well the func that you are passing into decor function and then calling needs to be called with argument as that is what it expects.
argument can be passed to def w() and from there pass it on to func()
def w(arg)
print()
func(arg)
print()