logo CodeStepByStep logo

list_mystery_ab

Language/Type: Python list mystery lists

Consider the following function, mystery.

def mystery(a, b):
    for i in range(len(a)): 
        a[i] += b[len(b) - 1 - i]

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

a1 = [1, 3, 5, 7, 9]
a2 = [1, 4, 9, 16, 25]
mystery(a1, a2)
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.