Skip to content

Instantly share code, notes, and snippets.

@clintmjohnson
Created September 16, 2015 23:21
Show Gist options
  • Save clintmjohnson/d4529e1049ba2db70c81 to your computer and use it in GitHub Desktop.
Save clintmjohnson/d4529e1049ba2db70c81 to your computer and use it in GitHub Desktop.
Do something to every item in a list function - python
n = [3, 5, 7]
def double_list(x):
for i in range(0, len(x)):
x[i] = x[i] * 2
return x
print double_list(n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment