Created
September 22, 2015 23:32
-
-
Save d9k/e18a31f6730e0ffc50de to your computer and use it in GitHub Desktop.
This file contains hidden or 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 t(*args): | |
return p(*args) | |
>>> | |
def p(*args): | |
i = 0 | |
for arg in args: | |
i += 1 | |
print('i='+str(i)+': '+str(arg)) | |
>>> | |
def p(*args): | |
i = 0 | |
for arg in args: | |
i += 1 | |
print(str(i) + ') ' + str(arg)) | |
>>> t(6, 1, 5) | |
1) 6 | |
2) 1 | |
3) 5 | |
This file contains hidden or 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 t(*args, **kwargs): | |
return p(*args, **kwargs) | |
>>> | |
def p(*args, **kwargs): | |
i = 0 | |
for arg in args: | |
i += 1 | |
print(str(i) + ') ' + str(arg)) | |
for key, value in kwargs.items(): | |
print(str(key) + ') ' + str(str(value))) | |
>>> t('a', 'za', 'za', t=45, yo=19) | |
1) a | |
2) za | |
3) za | |
yo) 19 | |
t) 45 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment