Created
January 22, 2010 10:20
-
-
Save soplakanets/283669 to your computer and use it in GitHub Desktop.
This file contains 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 append(value, list = None): | |
list = list or [] | |
list.append(value) | |
return list | |
print append(1) | |
print append(2) |
This file contains 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
[1] | |
[1,2] |
This file contains 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 append(value, list = []): | |
list.append(value) | |
return list | |
print append(1) | |
print append(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment