EasyOutput prediction

Decorator that prints after the call

What does this code print?

def log_done(func):
    def wrapper(*args, **kwargs):
        result = func(*args, **kwargs)
        print("done:", func.__name__)
        return result
    return wrapper

@log_done
def cube(n):
    return n ** 3

val = cube(3)
print(val)

← → arrow keys to navigate

Sign in to save your progress.

Decorator that prints after the call - Python Decorators Quiz | Unnested