Appending the list using function


#1




. list_extender([1, 2, 3, 4]) returned None, did you remember to return the result?

i dont understand why does it show up this error.please help.

when n is passed as the argument it should append 9 to it and simply return the appended list properly.isnt it as simple as that?


n = [3, 5, 7]
# Add your function here
def list_extender(lst):
    
    return lst.append(9)


print list_extender(n)


#2

yeah it is.

but the problem is what are you returning? what should you return?


#3

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