Data Types
Python's four scalar and four collection types—int, float, str, bool, list, tuple, dict, set—mutability, ordering, and hashability.
Lists, tuples, dictionaries, and sets.
View all tagsPython's four scalar and four collection types—int, float, str, bool, list, tuple, dict, set—mutability, ordering, and hashability.
Key/value lookup with dict, uniqueness and set algebra with set, and why keys must be immutable.
The mutable sequence — methods that change it in place, sort vs sorted, the reference trap, and comprehensions.
Indexing, the three-part slice, immutability, and the string methods worth knowing.
The immutable sequence — the trailing-comma rule, shallow immutability, unpacking, and when a tuple beats a list.