trying to do: python code challenges: loops (challenge number 3)
I know that the way I am trying to code this is different than the solution than they are giving, but I still wanted to try and get it to work.
This is what I have so far:
#Write your function here def delete_starting_evens(lst): for num in lst: if num % 2 == 0: lst.remove(num) else: break 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]))
when I run this code, the output is [8, 11, 15], and , and I really for the life of me cannot figure out what is going on here.