Jammed over result and caution message


#1



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

8
[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


#2

Return the complete list, rather than a single element.


#3

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:


#4

The lesson checker expects the complete list...

return x

#5

ohh i c, thanks that works


#6

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