Delete Starting Even Numbers Python 3 course, link:

So I some how managed to get the right code for the output, but im still puzzuling what the code ‘lst = lst[1:]’ is doing for the function? So for example if I write ‘lst = lst[0:]’ the output returns the original list which was put in the function , and when I write ‘lst = lst[2:]’ the function returns an empty list. Does anyone have an indea what ‘lst = lst[1:0]’ is specifically doing to the function? Any help would be greatly aprreciated.
The code for the function is here below.

def delete_starting_evens(lst):

for i in lst:

if i % 2 == 1:


lst = lst[1:]

return lst

print(delete_starting_evens([4, 8, 10, 11, 12, 15]))
Output: [11, 12, 15]

If open up python in my terminal I can interactively type something like

>>> word = "pitabread"
>>> word = word[1:]
>>> word
>>> word = word[1:]
>>> word
>>> word = word[1:]
>>> word
>>> word = word[1:]
>>> word

Do you see the pattern?

More explicitly [:] would give you from from index 0 to end, [1:] gives from index-1 to end.