Jammed over result and caution message


I see this result. looks like i got what was asked

[3, 8, 7]

But i am getting this caution message. I dint understand this message completely

Oops, try again. list_function([4, 1]) returned 4 instead of [4, 4]

n = [3, 5, 7]
def list_function(x):
    x[1] = x[1] + 3
    return x[1]
print list_function(n)
print n


Return the complete list, rather than a single element.


did not work. but what is the mistake in return x[1]. i modified index 1 of the list. so therefore, i thought its correct to give back the modified value to function.

in reality i did not understand the caution statement too :stuck_out_tongue:


The lesson checker expects the complete list...

return x


ohh i c, thanks that works


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