def kwargs_test(one, two=3, *args, **kwargs):
# * args 튜플형태로
# ** kwargs 사전형태로
# *(1,2,3,4,5) -> 1,2,3,4,5 unpacking 시에도 * 사용
print(one + two + sum(args))
print(two)
print(args)
print(kwargs)
kwargs_test(10, 20, 1, 2, 3, 4, first = 3, second = 2)
40
20
(1, 2, 3, 4)
{'first': 3, 'second': 2}'부스트캠프 AI Tech > Python' 카테고리의 다른 글
| [07] 내장함수 property와 Decorator (0) | 2022.01.13 |
|---|---|
| [06] Class, Inheritance, Visibility (0) | 2022.01.13 |
| [04] Black으로 파이썬 코드 스타일 통일하기 (0) | 2022.01.12 |
| [03] 문자열 함수 정리 (0) | 2022.01.12 |
| [02] if __name__=="__main__" (0) | 2022.01.12 |