logo CodeStepByStep logo

mystery_xyz

Language/Type: Python parameters print return

What output is produced by the following program?

def mystery(z, x, y):
    z -= 1
    x = 2 * y + z
    y = x - 1
    print(y, z)
    return x

def main():
    x = 1
    y = 2
    z = 3
    z = mystery(x, z, y)
    print(x, y, z)
    x = mystery(z, z, x)
    print(x, y, z)
    y = mystery(y, y, z)
    print(x, y, z)

main()
line 1
line 2
line 3
line 4
line 5
line 6

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.