11, List Manipulation in functions, Getting a syntax error, not sure why?



Im not sure what im doing wrong here, any help is appreciated, here are the errors i recieved

In the pop up:
Oops, try again. Your code looks a bit off. Check the console window for errors!

In the console window
File "python", line 3
def list_extender(1st):
SyntaxError: invalid syntax

(the ^ is pointing up at the 1 in 1st)

Heres my code

n = [3, 5, 7]
# Add your function here
def list_extender(1st):
    return 1st

print list_extender(n)


1st is not a valid identifier, pick a different name starting with something in the range [a-z], something along the lines of lst, sequence, seq, list_object, list_obj


Thanks! a bit odd that it told me to do this in the instructions, or am i misreading them?

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.


1 and l may look similar in some fonts, usually you'll want to use something where they are somewhat distinct:


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