Computer & Program/python37 [python] List 안녕하세요. TDR입니다. 오늘은 python에서의 list(배열) 자료구조의 기본적인 것에 대해 정리해 보겠습니다. ## 생성 list_object = [] list_object = list() list_object = [1, 2, 3, 4] ## 삽입 # list 마지막에 value 추가 list_object.append(value) # index 위치에 value 추가 list_object.insert(index, value) # list_object += [5, 6]과 동일 list_object.extend([5, 6] ## 읽기 # 3을 읽음 re = list_object[2] ## 수정 # list_object = [1, 2, 5, 4]가 됨 list_object[2] = 5 ## 삭제 # i.. 2024. 1. 16. 이전 1 2 3 4 다음