logo CodeStepByStep logo

if_else_mystery_1

Language/Type: Python if/else mystery

Consider the following function. For each call below, indicate what output is produced.

def if_else_mystery_1(x, y):
    z = 4
    if z <= x:
        z = x + 1
    else:
        z = z + 9
    if z <= y:
        y += 1
    print(z, y)
if_else_mystery_1(3, 20)
if_else_mystery_1(4, 5)
if_else_mystery_1(5, 5)
if_else_mystery_1(6, 10)

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.