11. List manipulation PLEASE HELP!


#1



Please, help me with this one. It seems very simple but I don't know what is wrong.
https://www.codecademy.com/courses/python-beginner-nzzVa/2/4?curriculum_id=4f89dab3d788890003000096

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)


#2

Hi, @sanaa25,

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

lst= lst.append(9)

#3

i was thinking it would add number 9 to the list


#4

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


#5

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