** Please check this question and give me an another way to this solve this problem. I had used the range in for loop but it could not able to include last element. So i had solved the problem but i want an another way to solve.
Create a function named
remove_middle which has three parameters named
start , and
The function should return a list where all elements in
lst with an index between
end (inclusive) have been removed.
For example, the following code should return
[4, 23, 42] because elements at indices
2 , and
3 have been removed:**
Here’s the Questions Exercise : https://www.codecademy.com/courses/learn-python-3/articles/advanced-python-code-challenges-lists
for i in range(start, end):
s = end - start - 1
#Uncomment the line below when your function is done
print(remove_middle([4, 8, 15, 16, 23, 42], 1, 3))