def PrintKwargs(**kwargs): print(kwargs);
PrintKwargs(a=1); |
{'a': 1}
def PrintKwargs(**kwargs): print(kwargs);
PrintKwargs(name='tester', age=34); |
{'name': 'tester', 'age': 34}
def AddAndMul(number1, number2): return number1 + number2, number1 * number2;
result = AddAndMul(3,4); print(result); |
(7, 12)
def AddAndMul(number1, number2): return number1 + number2, number1 * number2;
result1, result2 = AddAndMul(3,4); print(result1); print(result2); |
7
12
def DefaultParam(name, age = 20): print("name : %s" %name); print("age : %d" %age);
DefaultParam("tester"); DefaultParam("tester", 34); |
name : tester
age : 20
name : tester
age : 34
'Python' 카테고리의 다른 글
python lambda (0) | 2019.09.02 |
---|---|
python 함수3 (0) | 2019.09.02 |
python 함수1 (0) | 2019.08.27 |
python for활용 (0) | 2019.08.27 |
python while (0) | 2019.08.27 |