Data Types
Python's four scalar and four collection types — int, float, str, bool, list, tuple, dict, set.
Lists, tuples, dictionaries, and sets.
View all tagsPython's four scalar and four collection types — int, float, str, bool, list, tuple, dict, set.
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.