Created
September 16, 2015 23:21
-
-
Save clintmjohnson/d4529e1049ba2db70c81 to your computer and use it in GitHub Desktop.
Do something to every item in a list function - python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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