Question 4
Consider the following Python code snippet.
def update(func): def wrapper(N): out = [] for i in range(N): if i%2 == 0: out.append(i**3) else: out.append(i**2) return out return wrapper
@updatedef func(N): if N%2 == 0: return N**2 else: return N**3
print(func(5))What will be the output of the above code in the terminal?
25
125
[0, 1, 4, 27, 16]
[0, 1, 8, 9, 64]