They want me to go through a list and delete all the instances of even numbers. I should keep deleting even numbers until I reach an uneven number.
When I call my function with the arugments 4,8 and 10, my function will return a 10. I don't know why, shouldn't my if statement solve that?
def delete_starting_evens(lst):
for number in lst:
if number%2==0 and len(lst)>0:
lst.pop(0)
else:
break
return lst
print(delete_starting_evens([4, 8, 10, 11, 12, 15]))
print(delete_starting_evens([4, 8, 10]))