logo CodeStepByStep logo

parameter_mystery_exam2

Language/Type: Python parameters return

The following console program uses parameters and produces five lines of output. What are they?

def orange(z, y, x):
    print(y, "and", z, "were", x)
    return x + y + z

def main():
    x = "happy"
    y = "pumpkin"
    z = "orange"
    pumpkin = "sleepy"
    orange = "vampire"

    orange(y, x, z)
    x = orange(x, z, y)
    orange(pumpkin, z, "y")
    z = "green"
    orange("x", "pumpkin", z)
    orange(x, z, orange)

main()
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.