choco's story
파이썬 스터디 28 - items() 함수 본문
items() 함수
키(Key)와 값(Value)을 동시에 얻을 수 있는 함수
기본구조
for 키, 값 in [딕셔너리 이름].items():
코드
ex)
example_dict = {
"A": "a",
"B": "b",
"C": "c"
}
example_dict.items()
for key, element in example_dict.items():
print("dict[{}] = {}".format(key, element))

'프로그래밍 언어 공부 (Coding Study) > 파이썬 (Python) 기본' 카테고리의 다른 글
| 파이썬 스터디 30 - 함수의 개념 (0) | 2024.09.21 |
|---|---|
| 파이썬 스터디 29 - 리스트 내포 (리스트 내부의 for문, if문) (1) | 2024.09.20 |
| 파이썬 스터디 27 - enumerate() 함수 (0) | 2024.09.20 |
| 파이썬 스터디 26 - reversed() 함수 (1) | 2024.09.20 |
| 파이썬 스터디 25 - min(), max(), sum() 함수 (1) | 2024.09.20 |
