meta data for this page
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
python:list [2013/08/06 05:48] moonrepeat |
python:list [2021/03/10 21:42] (현재) |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Python List ====== | ====== Python List ====== | ||
===== Method ===== | ===== Method ===== | ||
- | ^ Method ^ Desc ^ Example | + | ^ Method ^ Desc ^ Example | |
- | ^ append |자료를 리스트 끝에 추가| >>> s=[1,2,3]\\ >>> s.append(5)\\ >>> s\\ [1,2,3,5] | | + | ^ append |자료를 리스트 끝에 추가|>>> s=[1,2,3]\\ >>> s.append(5)\\ >>> s\\ [1,2,3,5] | |
- | ^ insert |자료를 지정된 위치에 삽입| >>> s=[1,2,3,5]\\ >>> s.insert(3,4)\\ >>> s\\ [1,2,3,4,5] | | + | ^ insert |자료를 지정된 위치에 삽입|>>> s=[1,2,3,5]\\ >>> s.insert(3,4)\\ >>> s\\ [1,2,3,4,5] | |
^ index |요소 검색 |>>> s=[1,2,3,4,5]\\ >>> s.index(3)\\ 2 | | ^ index |요소 검색 |>>> s=[1,2,3,4,5]\\ >>> s.index(3)\\ 2 | | ||
^ count |요소 개수 알아내기 |>>> s=[1,2,3,4,5]\\ >>> s.count(2)\\ 1 | | ^ count |요소 개수 알아내기 |>>> s=[1,2,3,4,5]\\ >>> s.count(2)\\ 1 | |