Functions
10 / 20
EasyOutput prediction

Tracing a simple recursive function

What does this code print?

def countdown(n):
    if n == 0:
        print("done")
        return
    print(n)
    countdown(n - 1)

countdown(3)

← → arrow keys to navigate

Sign in to save your progress.

Tracing a simple recursive function - Python Functions Quiz | Unnested