Python Types
Collection Data Types
get length: len(dict)
List
list = [10, 20, 30]
Lists are used to store multiple items in a single variable.
- ordered
- changeable
- allow duplicate values
Tuple
Set
Dictionary
dict = {
"a": "abc",
"year": 1986
}
- not allow duplicate values - Dictionaries cannot have two items with the same key.
- changeable
- unordered in old version, ordered in new version