I am trying to understand the concept of decorators in python when we have different arguments (In fact I am not sure how to pass arguments to the decorator). I have written the small and simple code below but I am not able to run it:
def advance(*arg, function):
result = a * function(b, c)
print(result)
@advance
def Sum1(b, c):
return b + c
print(Sum1(1, 2, 3))
When running the code, I get TypeError: advance() missing 1 required keyword-only argument: 'function'.