Python Decorator function generating error

The following code generating an error that reads “TypeError: wrap() takes 0 positional arguments”. Can you please explain the reason and the possible solution to this, please.

'''OUTPUT FORMAT 
***
INVOICE #128
***
END OF PAGE
'''

#your code goes here

def decor(func):
    def wrap():
        print("***")
        func()
        print("***")
        print("END OF PAGE")
    return wrap

@decor
def invoice(num):
    print("INVOICE #" +num)

invoice(input());

okay so, I just passed args to both wrap and fun() function by looking at the error and it works now.

def wrap(arg):
    print("***)
    func(arg)
    print("***)

I used the error msg to figure that out but I still don’t understand how it works. Request you to please explain the flowchart of this code. Thanks in advance!

This doesn’t differ much from the normal function behavior where it has to be called with appropriate arguments, otherwise there will be an error.

decor wraps passed funcwith the wrap function and then returns it. At this point the decorated function will accept as many arguments as in wrap function definition.