문서 편집 권한이 없습니다. 다음 이유를 확인해주세요:
요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자.
=== 튜플 딕셔너리 리스트 차이점 ,특징 === {| class="wikitable" |+ List, Dictionary, Tuple 비교 ! 구분 !! List !! Dictionary !! Tuple |- ! 정의 | Ordered, mutable sequence of items |Unordered, mutable collection of key-value pairs | Ordered, immutable sequence of items |- ! 사용 문법 | `[1, 2, 3]` | `{'key1': 'value1', 'key2': 'value2'}` | `(1, 2, 3)` |- ! Mutable? | Yes | Yes | No |- ! Indexed Access | Yes (by index) | Yes (by key) | Yes (by index) |- ! 증복허용 여부 | Yes | No (keys must be unique) | Yes |- ! 사용예시 | Storing collections of items where order matters | Storing key-value pairs for fast lookup | Storing fixed collections that should not change |- ! 언제 사용 하나? | When you need an ordered and mutable sequence | When you need to associate values with unique keys | When you need an ordered and immutable collection |- ! Example | <source lang="python"> my_list = [1, 2, 3] print(my_list[0]) # Output: 1 </source> |<source lang=python> my_dict = {'name': 'Alice', 'age': 25} print(my_dict['name']) # Output: Alice </source> |<source lang=python> my_tuple = (1, 2, 3) print(my_tuple[1]) # Output: 2 </source> |} [[category:python]]
문서 저장 미리 보기 차이 보기 취소