Created
October 9, 2012 23:09
-
-
Save jvanasco/3862048 to your computer and use it in GitHub Desktop.
default argument
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
def f(a,L=[]): | |
L.append(a) | |
return L | |
for i in range(0,3): | |
print f(i) | |
for i in range(3,6): | |
print f(i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment