[Python] 자료구조


[Python] 자료구조

리스트(배열) 리스트(배열) subway = [10, 20, 30] print(subway) >>> [10, 20, 30] subway = ["유재석", "조세호", "박명수"] print(subway) >>> ['유재석', '조세호', '박명수'] 특정 문자열 인덱스 찾기 print(subway.index("조세호")) >>> 1 "append" 뒤에 배열 추가 subway.append("하하") print(subway) >>> ['유재석', '조세호', '박명수', '하하'] "subway" 객체에 첫 번째 인덱스에 값을 넣는다. subway.insert(1, "정형돈") print(subway) >>> ['유재석', '정형돈', '조세호', '박명수', '하하'] "pop"은 뒤에서부터 출력 가능 print(subway.pop()) print(subway) >>> 하하 >>> ['유재석', '정형돈', '조세호', '박명수'] print(subway.pop()) print(su...


#python #자료구조 #파이썬

원문링크 : [Python] 자료구조