Baheeg Training and Test Exam

Python intermediate Level

Score: 0 / 0 answered

Progress: 0 of 817 qs

time elap: 00:00

Question 1: What is the output of the following code?

def timer(func):
    def wrapper(*args, **kwargs):
        import time
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(f"Time taken: {end - start} seconds")
        return result
    return wrapper

@timer
def slow_function():
    import time
    time.sleep(2)
    return "Done!"

print(slow_function())