Skip to content

Instantly share code, notes, and snippets.

@arn-e
Created April 5, 2013 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arn-e/5322814 to your computer and use it in GitHub Desktop.
Save arn-e/5322814 to your computer and use it in GitHub Desktop.
# Python
def my_func(arg_1 = []):
arg_1.append(1)
print arg_1
my_func()
my_func()
# $ python test.py
# [1]
# [1, 1]
# Ruby
def my_func(arg_1=[])
arg_1.push(1)
p arg_1
end
my_func
my_func
# $ ruby test.rb
# [1]
# [1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment