Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created November 4, 2018 23:57
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/f686ec9ee3be438c3077a475486972da to your computer and use it in GitHub Desktop.
Save codecademydev/f686ec9ee3be438c3077a475486972da to your computer and use it in GitHub Desktop.
Codecademy export
#Write your function here
def double_index(lst, index):
if index < len(lst):
return lst[index] * 2
else:
return lst
#Uncomment the line below when your function is done
print(double_index([3, 8, -10, 12], 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment