"""Worked examples from this week's handout.

Run one lesson's test calls at a time. Predict the output first.
Use small, non-negative whole numbers only.
"""

# Monday: a function returns a value.
def add_one(n):
    return n + 1


# Tuesday and Wednesday: a function calls itself and prints.
def countdown(n):
    if n == 0:
        print("Go")
        return
    print(n)
    countdown(n - 1)


# Friday: a function returns an answer from smaller calls.
def total_to(n):
    if n == 0:
        return 0
    return n + total_to(n - 1)


# Remove the # from ONE test below when ready.
# print(add_one(3))
# countdown(2)
# print(total_to(2))
