copy() 2

[9-4 파이썬] 딕셔너리 내장메서드, clear(), copy(), fromkeys(), get(), items(), keys(), values(), pop(), popitem()

파이썬 딕셔너리 내장메서드 메서드 Method 설명 Description 방법 clear() 딕셔너리 내 모든 요소 지우기 dictionary.clear() copy() 똑같은 딕셔너리를 복제하기 dictionary.copy() fromkeys() 특정 키, 특정 벨류 값을 가진 딕셔너리 생성하기 dictionary.fromkeys(keys, value) get() 딕셔너리 내 특정 키의 벨류 값을 가져오기 dictionary.get(key) items() 딕셔너리의 각각의 키와 벨류를 튜플로 묶어낸 리스트 반환하기 dictionary.items() keys() 딕셔너리의 키 값들을 리스트로 반환하기 dictionary.keys() values() 딕셔너리의 벨류 값들을 리스트 형태로 반환하기 dicti..

[4-3 파이썬] 리스트함수, append(), extend(), insert(), remove(), pop(), clear(), count(), sort(), reverse(), copy()

리스트 관련 함수 이번 시간에는 리스트의 값을 변경할 수 있는 함수에 대해 알아보겠다. list.append(x) Add an item to the end of the list. Equivalent to a[len(a):] = [x]. 리스트의 끝에 값을 첨가하는 것. list.extend(iterable) Extend the list by appending all the items from the iterable. Equivalent to a[len(a):] = iterable. 리스트의 끝에 리스트를 첨가하는 것 list.insert(i, x) Insert an item at a given position. The first argument is the index of the element befor..