Last active
April 27, 2016 21:08
-
-
Save rahulkp220/330fc1e9e8b34afa8eaa8f57e94f392c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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