Type | Object Class | Example | Mutable | Notes |
---|---|---|---|---|
Text | str | "abc" 'ABC' '''xyz''' | NO | |
Numeric | int | 123 | NO | |
Numeric | float | 123.4 456E10 -.01e-3 | NO | |
Numeric | complex | 3 + 6j (3 + 6j) | NO | x = complex(3,6) x.real, x.imag |
Sequence | list | [ 'a', 'b', 123, False ] | YES | |
Sequence | tuple | ( 'a', True, 123 ) | NO | |
Sequence | range | range(10) → 0,1,2,...,9 | NO | |
Mapping | dict | { 'a': 1, 'b' : 2, 'c' : 3 } | YES | |
Set | set | { 'a', 'b', 'c' } | YES | |
Set | frozenset | ({ 'a', 'b', 'c' }) | NO | frozenset({ 'a', 'b', 'c' }) y = { 'a','b','c' } frozenset(y) |
Boolean | bool | values: True, False x = True | YES | variable x is mutable values True/False are not mutable |
Binary | bytes | b'abc' | NO | |
Binary | bytearray | bytearray(64) | YES/NO | complex topic see documentation for examples |
Binary | memoryview | memoryview(bytes(128)) | YES/NO | complex topic see documentation for examples |