Consider the following decorator that takes a function with two arguments and prints the arguments before calling the function.
def print_info(func):
def wrapper(arg1, arg2):
print("The arguments of the function are:", arg1, arg2)
return func(arg1, arg2)
return wrapper
Let's say we use this decorator for a function that simply returns the sum of two arguments. Then, the result for the values 22 and 25 will be the following:
The arguments of the function are: 22 25
47
Your task is to:
- Write the body of the function that computes and returns the sum of two arguments.
- Decorate this function with
print_infodecorator.
Tip: Use return, not print().