logo CodeStepByStep logo

list_mystery2_xy

Language/Type: Python list mystery lists

Consider the following function, mystery.

def mystery2(data, x, y):
    data[data[x]] = data[y]
    data[y] = x

What are the values of the elements in list numbers after the following code executes?

numbers = [3, 7, 1, 0, 25, 4, 18, -1, 5]
mystery2(numbers, 3, 1)
elements

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.