Created
November 10, 2015 15:23
-
-
Save swshan/84c858ef9f22ee525f00 to your computer and use it in GitHub Desktop.
Learning Python example for argument
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
#coding=utf-8 | |
def function_get_args(a,b,c): | |
print a,b,c | |
return_val = a * 5 | |
return return_val | |
def function_get_args_return_tuple(a,b,c): | |
print a,b,c | |
return_val = a * 5 | |
return return_val, b | |
def function_get_args_return_dict(a,b,c): | |
print a,b,c | |
return_val = a * 5 | |
return {'k1': a, 'k2': b, 'k3': c * 10} | |
if __name__ == '__main__': | |
r = function_get_args('blll', 'a', 'c') | |
print r | |
print '==========' | |
r2 = function_get_args_return_tuple('a', 'b', 'c') | |
print r2 | |
print '==========' | |
r3 = function_get_args_return_dict('a', 'b', 'c') | |
print r3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment