Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created September 17, 2020 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/1c341009487aba90c874e4a0e60814b6 to your computer and use it in GitHub Desktop.
Save codecademydev/1c341009487aba90c874e4a0e60814b6 to your computer and use it in GitHub Desktop.
Codecademy export
#Write your function here
def odd_indices(lst):
new_lst = []
for index in range(1, len(lst), 2):
new_lst.append(lst[index])
return new_lst
#Uncomment the line below when your function is done
print(odd_indices([4, 3, 7, 10, 11, -2]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment