11/18 List Manipulation in functions


#1



https://www.codecademy.com/courses/python-beginner-nzzVa/2/4?curriculum_id=4f89dab3d788890003000096 <<< Link

Oops, try again.
list_extender([1, 2, 3, 4]) returned [1, 2, 3, 4, 4] instead of [1, 2, 3, 4, 9]

^^
Error Message


Here is my code:

n = [3, 5, 7]
def list_extender(lst):
    lst.append(4)
    return lst


print list_extender(n)

what did I do wrong?:anguished:


Replace this line with your code.


#2

Inside the function, append the number 9 to lst.

Your function is appending the number 4,


#3

Thanks! Oops! I guess I was looking at the example and did that. :joy:


#4

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