13/18 error



It says: "Oops, try again. double_list([0, 1]) resulted in an error: list index out of range"

n = [3, 5, 7]

def double_list(x):
    for i in range(0, len(n)):
        x[i] = x[i] * 2
    return x

print double_list(n)


change to len(x). n is a global that cannot be seen inside the block.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.