Created
September 11, 2014 00:45
-
-
Save drwebb/9267d9c27f4f5ab2b4b3 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 appendWithDefault(val, lst = []): | |
lst.append(val) | |
return lst | |
val = 42 | |
mylist = appendWithDefault(val) | |
print(mylist) | |
# Does this do what you expect? | |
mylist2 = appendWithDefault(101) | |
print(mylist2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment