목차
- dictionary.popitem() 예제 - 마지막 item 제거
- dictionary.popitem() 정의
- dictionary.popitem() 구문
- dictionary.popitem() 예제 - 제거된 item 반환
dictionary.popitem() 예제 - 마지막 item 제거
hz ={
"site": "홈짱닷컴",
"host": "Homzzang.com",
"open": 2012
}
hz.popitem()
print(hz)
결과값: {'site': '홈짱닷컴', 'host': 'Homzzang.com'}
dictionary.popitem() 정의
Dictionary의 마지막 item 제거 후, 제거된 item 반환.
cf.
Python 3.7 이전 버전 경우, 랜덤으로 Item 제거.
dictionary.popitem() 구문
dictionary.popitem()
[매개변수]
없음.
dictionary.popitem() 예제 - 제거된 item 반환
hz ={
"site": "홈짱닷컴",
"host": "Homzzang.com",
"open": 2012
}
x = hz.popitem()
print(x)
반환값: ('open', 2012)
최신댓글