--- id: python-lists title: "Python Lists" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["파이썬 리스트"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["python", "programming", "w3schools", "lists"] raw_sources: ["https://www.w3schools.com/python/python_lists.asp"] applied_in: [] github_commit: "" --- # [[Python Lists]] ## 🎯 한 줄 통찰 (One-line insight) Lists are one of Python's four collection types — ordered, changeable, duplicate-allowing, and mixed-type-capable — distinguished from Tuple (unchangeable), Set (unordered, no duplicates), and Dictionary (key-value, no duplicates). [S1] ## 🧠 핵심 개념 (Core concepts) - **List** — stores multiple items in a single variable; created with square brackets. [S1] - **Ordered** — items have a defined order that persists (new items go to the end) unless a method explicitly reorders them. [S1] - **Changeable (mutable)** — items can be changed, added, or removed after creation. [S1] - **Allows duplicates** — since lists are indexed, identical values can appear multiple times. [S1] - **Mixed types** — a single list can hold strings, ints, booleans together. [S1] - **`list()` constructor** — alternative creation syntax: `list(("apple", "banana", "cherry"))`. [S1] - **Four collection types compared** — List (ordered, changeable, duplicates OK), Tuple (ordered, unchangeable, duplicates OK), Set (unordered, effectively unchangeable, no duplicates), Dictionary (ordered since 3.7, changeable, no duplicate keys). [S1] ## ⚖️ 비교 및 선택 기준 (Comparison & decision criteria) | 항목 (Option) | 장점 | 단점 | 언제 선택 | |---|---|---|---| | **List** | 순서 보장, 변경 가능, 중복 허용 | Set 대비 멤버십 검사가 느림 | 순서가 중요하고 자주 수정되는 컬렉션 | | **Tuple** | 불변이라 안전, 해시 가능 | 생성 후 수정 불가 | 변경되면 안 되는 고정 데이터 | | **Set** | 빠른 멤버십 검사, 중복 자동 제거 | 순서 없음, 인덱싱 불가 | 고유값 집합 연산이 필요할 때 | | **Dictionary** | 키로 빠른 조회, 3.7+부터 순서 보장 | 중복 키 불가 | 이름-값 매핑이 필요할 때 | ## 📖 세부 내용 (Details) - Basic creation: `thislist = ["apple", "banana", "cherry"]`. [S1] - Duplicates allowed: `thislist = ["apple", "banana", "cherry", "apple", "cherry"]`. [S1] - Mixed types: `list1 = ["abc", 34, True, 40, "male"]`. [S1] - Length: `print(len(thislist))`. [S1] - Type check: `print(type(mylist)) # `. [S1] ## ⚖️ 모순 및 업데이트 (Contradictions & updates) - **딕셔너리 순서 보장은 버전에 따라 다름**: Python 3.7+부터는 순서가 보장되지만, 3.6 이전에는 순서가 보장되지 않았다는 점이 명시됨. [S1] ## 🛠️ 적용 사례 (Applied in summary) 현재 발견된 실제 적용 사례가 없습니다 — 이후 Access/Change/Add/Remove/Loop/Sort/Copy/Join/Methods 챕터 전체의 기초가 되는 개론 문서다. [S1] ## 💻 코드 패턴 (Code patterns) Basic list creation and type check (Python): ```python thislist = ["apple", "banana", "cherry"] print(type(thislist)) # ``` ## ✅ 검증 상태 및 신뢰도 - **상태:** draft - **검증 단계:** conceptual - **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body) - **신뢰 점수:** 0.90 - **중복 검사 결과:** 신규 생성 (New discovery) ## 🔗 지식 그래프 (Knowledge Graph) - **상위/루트:** [[Python Tutorial]] - **관련 개념:** [[Python Tuples]], [[Python Sets]], [[Python Dictionaries]], [[Python Data Types]] - **참조 맥락:** Python 4대 컬렉션 타입 중 하나 — Tuple/Set/Dictionary와의 차이를 이해하는 것이 핵심. ## 📚 출처 (Sources) - [S1] W3Schools — Python Lists — https://www.w3schools.com/python/python_lists.asp ## 📝 변경 이력 (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "Python Lists" page (Astra wiki-curation, P-Reinforce v3.1 format).