13/18 error


#1



13/18


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)


#2

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


#4

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