I’m not sure what happened, but I responded to a message in another thread and it seems that my question was moved to it’s own thread.
Any way, I have several questions about the delete starting even numbers coding challenge.
The prompt reads "
Write a function called
delete_starting_evens() that has a parameter named
The function should remove elements from the front of
lst until the front of the list is not even. The function should then return
For example if
lst started as
[4, 8, 10, 11, 12, 15] , then
delete_starting_evens(lst) should return
[11, 12, 15] .
Make sure your function works even if every element in the list is even!"
My initial response was this:
for num in lst:
if len(lst) > 0 or num % 2 == 0 :
It seems that this only removed the first two elements of the list and then stops iterating. Could you explain why please?