Skip to content

Instantly share code, notes, and snippets.

@codecademydev codecademydev/ Secret
Created Jan 31, 2019

What would you like to do?
Codecademy export
#Write your function here
def delete_starting_evens(lst):
#for num in lst:
#if lst[0] % 2 == 0:
#lst = lst[1:]
#return lst
for num in lst:
if lst[0] % 2 == 0:
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]))

This comment has been minimized.

Copy link

Gowtham-Sridhar commented Feb 13, 2019

def delete_starting_evens(lst): empty = [] for element in lst: if element % 2 != 0: index = lst.index(element) return lst[index:] return empty

How about with this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.