12/11 List manipulation in functions


#1



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


File "python", line 4
def list_extender(1st):
^
SyntaxError: invalid syntax


It seems that using 1st as a parameter is causing a syntax error. If I replace (1st) with something else like (hi) it works just fine.


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

def list_extender(1st):
    1st.append(9)
    return 1st

print list_extender(n)


#2

I made the same mistake. It's lst, not 1st. As in the letter 'L' (lower cap though).


#3

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