meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:python:syntax:collections [2024/03/01 07:41] – created niziak | programming:python:syntax:collections [2025/01/02 11:02] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== collections ====== | ====== collections ====== | ||
- | * List '' | + | |
* ordered, indexed, allow duplicate items | * ordered, indexed, allow duplicate items | ||
* mutable | * mutable | ||
- | | + | * list item can be any type |
+ | * '' | ||
+ | * **Tuple** '' | ||
* ordered, indexed, allow duplicate items | * ordered, indexed, allow duplicate items | ||
- | * immutable | + | |
- | * Set | + | * tuple item can be any type |
- | * unordered, unindexed, no duplicate items | + | |
+ | | ||
+ | * '' | ||
* items are immutable | * items are immutable | ||
* set is mutable (add/remove items) | * set is mutable (add/remove items) | ||
- | | + | * set item can be any type |
- | * ordered (from v3.7) | + | * **Dictionary** '' |
+ | * stores '' | ||
+ | * ordered (from v3.7), no duplicate items (keys) | ||
* mutable | * mutable | ||
- | * no duplicate items | + | * value can be any type |