11. List manipulation PLEASE HELP!


Please, help me with this one. It seems very simple but I don't know what is wrong.

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

n = [3, 5, 7]
# Add your function here

def list_extender(lst):
  return lst.append(9)

print list_extender(n)


Hi, @sanaa25,

What does the append method return here? That is what you are assigning to lst.

lst= lst.append(9)


i was thinking it would add number 9 to the list


That is what it does, but then you are assigning what it returns to lst. What does the append method return?


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