[Python]딕셔너리의 메소드
person = {'이름' : '홍길동', '나이' :26, '몸무게': 82} person.key() #예상 출력 : dict_keys(['이름', '나이', '몸무게']) person.value() #예상 출력 : dict_values(['홍길동', 26, 82]) person.items() #예상 출력 : dict_items([('이름', '홍길동'), ('나이', 26), ('몸무게', 82)]) print(person.get("이름")) #예상 출력 : 홍길동 print(person.pop("이름")) person #예상 출력 : 홍길동 {'나이': 26, '몸무게': 82} print(person.popitem()) person # 예상 출력 : ('몸무게', 82) {'나이': 26} pri..
2024.04.11