Skip to content

Instantly share code, notes, and snippets.

@ralflukner
Created November 26, 2012 00:34
Show Gist options
  • Save ralflukner/4146022 to your computer and use it in GitHub Desktop.
Save ralflukner/4146022 to your computer and use it in GitHub Desktop.
Mutable inside function
def f(a, L=[]):
L.append(a)
return L
print f(1)
print f(2)
print f(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment