목차
- dictionary.update() 예제 - Item 추가
- dictionary.update() 정의
- dictionary.update() 구문
dictionary.update() 예제 - Item 추가
hz ={
"site": "홈짱닷컴",
"host": "Homzzang.com",
"open": 2012
}
hz.update({"intro": "코딩강의"})
print(hz)
결과값:
{'site': '홈짱닷컴', 'host': 'Homzzang.com', 'open': 2012, 'intro': '코딩강의'}
dictionary.update() 정의
Dictionary에 지정 item (= key:value 쌍)을 추가.
※ 지정 item은 Dictionary이거나 key:value 쌍의 반복 가능 객체.
dictionary.update() 구문
dictionary.update(iterable)
[매개변수]
iterable
필수. 추가할 item. (예: key:value 형태의, Dictionary이거나 반복 가능 객체.)
최신댓글