List manipulation in function


#1

n = [3, 5, 7]

Add your function here

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

print list_extender(n)

i keep on getting

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


#2

Try lst instead of 1st. (That is, lowercase L.)


#4

thnx i got it finally


#5

Why can't we .append 9 to list_extender but instead must .append to (lst)

in other words, I first did this:

list_extender. append(9)

didn't work.

this did:

lst.append(9)

???


#6

list_extender is a function, not a variable. You can't add anything to it, because it's a set of instructions. Functions don't hold values.


#7

Okay, thanks james.rhea