from collections import defaultdict
int_dict = defaultdict(int) # x : 0
str_dict = defaultdict(str) # x : ''
list_dict = defaultdict(list) # x : []
이런 식으로 기본 값을 지정할 수 있다.
'Programing > Python' 카테고리의 다른 글
python 내장함수 all, any에 대해 알아보자 (0) | 2022.05.27 |
---|---|
Python 메모리 관리 (Garbage Collection) (0) | 2022.04.22 |
재귀 깊이 수정 (python) (0) | 2022.03.10 |
pip install SSL: CERTIFICATE_VERIFY_FAILED 해결방법 (0) | 2021.07.07 |
python Bson 라이브러리 (0) | 2020.11.04 |