logo CodeStepByStep logo

list_mystery3_xy

Language/Type: Python list mystery lists

Consider the following function, mystery. What value does the function return when passed each of the following lists?

def mystery3(lis):
    x = 0
    for i in range(1, len(lis)): 
        y = lis[i] - lis[0]
        if y > x:
            x = y
    return x
[5]
[3, 12]
[4, 2, 10, 8]
[1, 9, 3, 5, 7]
[8, 2, 10, 4, 10, 9]

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.