I am quite new here even though I have been on Codecademy for a while now. for this particular code:
#Write your function here def delete_starting_evens(lst): while (len(lst) > 0 and lst % 2 == 0): lst = lst[1:] return lst #Uncomment the lines below when your function is done print(delete_starting_evens([4, 8, 10, 11, 12, 15])) print(delete_starting_evens([4, 8, 10]))
I understand the code basically but what I do not understand is why the loop kept going after it found that the value at index 0 of lst is even. there are two conditions for the loop, and I am sure it met the second condition when it found that the value at lst is even… I thought it should have given the output [8, 10, 11, 12, 15] but it made sure it went over the lst, removed all the even numbers in front of the first odd number… please how did the while loop achieve this??