Skip to content

Instantly share code, notes, and snippets.

@atqamar
Last active February 1, 2016 19:34
Show Gist options
  • Save atqamar/da151d3da5ec5616f88d to your computer and use it in GitHub Desktop.
Save atqamar/da151d3da5ec5616f88d to your computer and use it in GitHub Desktop.
>>> def f(a, b, *args, **kwargs):
... print 'a:', a
... print 'b:', b
... print 'args:', args
... print 'kwargs:', kwargs
...
>>>
>>> f(1, 2, 3, 4)
a: 1
b: 2
args: (3, 4)
kwargs: {}
>>> f(1, 2, 3, 4, banana=7, apple=9)
a: 1
b: 2
args: (3, 4)
kwargs: {'banana': 7, 'apple': 9}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment