List manipulation in functions


#1

Hi,

I'm struggling with this challenge.

Here are the instructions:

Define a function called list_extender that has one parameter lst.
Inside the function, append the number 9 to lst.
Then return the modified list.


Here is my code:

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


print list_extender(n)

Thanks to anyone that can help.

  • Harry

#2

list_extender is the name of your function rather than the name of your modified list. Change line 5 to:
return lst