logo CodeStepByStep logo


Language/Type: Python recursion

Given the function below, what is the output of the following call? (What is the function really doing?)

def mystery(n):
    if n < 10:
        return n
        a = n // 10
        b = n % 10
        return mystery(a + b)
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.