[4, 23, 42]
When you call the function, you’re passing through 3 arguments: a list (lst), starting point and end point.
[:start] will give you the item at the beginning of the list to the stop point. (the stop point as indicated in the function call is 1), which is the number 8, so, the function returns 4.
[end+1:] will give you the end of the list (whatever the number is) plus 1 (ie: moving to the right). The end here is index 3, which is the number 16 in the list, +1 to that is 23.
You’ve removed the elements at indicies 1, 2, & 3 or, the middle of the list.
Pass through different lists of numbers and starting and end points and see what happens. change it up so you understand it better.
Ex: what happens if I pass this through? What is returned?
print(remove_middle([99, 8, 27, 15, 12, 1, 44], 1, 4))