Python is a dynamically typed language — variables hold references to objects, and the type is determined at runtime.
| Type | Example | Notes |
|---|---|---|
| int | 42, -7, 0 | Arbitrary precision |
| float | 3.14, 1e-9 | IEEE 754 double |
| bool | True, False | Subclass of int |
| str | "hello" | Immutable Unicode |
| NoneType | None | Absence of value |
Python gotcha: Integer division // rounds toward negative infinity: -7 // 2 == -4, not -3.
What does the // operator do in Python?
What type does Python assign to 3.14?
type(True) in Python returns
Which operator gives the remainder of division?
2 ** 8 evaluates to