Skip to content

Instantly share code, notes, and snippets.

@1dolinski
Last active December 12, 2015 03:21
Show Gist options
  • Select an option

  • Save 1dolinski/522083e7cdd34243286d to your computer and use it in GitHub Desktop.

Select an option

Save 1dolinski/522083e7cdd34243286d to your computer and use it in GitHub Desktop.
# i is a default argument
def x(i=1):
return i
# you can do this
def x(b, i=1)
return i + b
# you can't do this
def x(i=1, b)
return i + b
# a function that returns something
def add(a,b):
return a + b
# a function that interacts with the current code
res = 0
def add2(a,b):
res = a + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment