Skip to content

Instantly share code, notes, and snippets.

@rahulkp220
Last active April 27, 2016 21:08
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 rahulkp220/330fc1e9e8b34afa8eaa8f57e94f392c to your computer and use it in GitHub Desktop.
Save rahulkp220/330fc1e9e8b34afa8eaa8f57e94f392c to your computer and use it in GitHub Desktop.
def sample(a,*args,**kwargs):
print “a is {}”.format(a)
print “*args is a tuple {}”.format(args)
print “**kwargs is a dictionary {}”.format(kwargs)
>>> sample(1,2,3,4,name=”rahul”,age=26)
a is 1
*args is a tuple (2, 3, 4)
**kwargs is a dictionary {‘age’: 26, ‘name’: ‘rahul’}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment