logo CodeStepByStep logo

if_else_mystery2

The following code produces 5 lines of output. What is the output? Write each line of output as it would appear on the console.

def mystery(x, y):
    if x > y:
        x = x - 5
        y = y + 5
    if x < y:
        x += 1
        y -= 1
    else:
        x = y * 2
    print(x, y)

mystery(4, 7)
mystery(3, 3)
mystery(10, 5)
mystery(20, 4)
mystery(1, 1)
line 1
line 2
line 3
line 4
line 5

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.