# Trouble with understanding list slicing

For this exercise the following is the correct code:

``````#Write your function here
def remove_middle(lst, start, end):
return lst[:start] + lst[end+1:]

#Uncomment the line below when your function is done
print(remove_middle([4, 8, 15, 16, 23, 42], 1, 3))
``````

Maybe I missed something but I dont understand what the parameter of “1st” is doing in this code specifically as well as the “start” and “end”. Maybe I’ve missed something, but im having a hard time understanding as whole what’s going on here. I get what the code is doing, that is simple but what is the parameter of 1st, start, and end doing exactly in this code exactly do get the results. In previous exercises I remember assigning a variable with to a function with listed parameters. I dont how it works here at all. What am I not seeing?

any change you still have this example?

your question seems more about functions, parameters and arguments then list slicing.

your function has 3 parameters:

``````lst, start, end
``````

each parameter correspond with an argument at function call:

``````lst = [4, 8, 15, 16, 23, 42]
start = 1
end = 3
``````

this is known as positional arguments, each argument corresponds with the parameter at the same position.

Thanks but I just dont get how start, end and 1st are being defined. I’ve seen alot of frustration from browsing the forums regarding these exercises for challenges starting from this link https://www.codecademy.com/courses/learn-python-3/lessons/python-functions-lists-cc/exercises/introduction?action=resume_content_item
for about 11 lessons.

I’ll just skip these as I’ve been doing fine up until this point, i think it has more to do with the poor explanation of what’s going on here. thanks.

then i would recommend revisiting the parameter lesson: