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
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:

also the next lesson (multiple parameters) might be helpful.

but the parameters and arguments concept have already been explained? Each lesson can’t recap everything that has been taught up till that point.

Programming is a constant learning process, and sometimes you need to refresh concepts you already learned because you haven’t used them in a while. You just read upon the matter until you understand, you can google, read other resources and so forth.

I understand the function parameter lesson just fine. WE ASSIGN them in other lessons. I dont see how they are assigned here. I’ve done the projects with no issues at all. Im also working off other sites than this one for learning and I’m doing fine what’s asked of me with functions, including make a number chance game with three guess. I just dont see where they are being assigned here, If it’s not okay to be new and ask these questions Im fine with not asking them, have a good day !

can you show me an example of this? So i can understand what is different in the list slicing lesson.

asking questions is totally fine and a good thing to do :slight_smile: