Python3 Built-In Data Types

TypeObject
Class
ExampleMutableNotes
Textstr"abc"
'ABC'
'''xyz'''
NO
Numericint123NO
Numericfloat123.4
456E10
-.01e-3
NO
Numericcomplex3 + 6j
(3 + 6j)
NO x = complex(3,6)
x.real, x.imag
Sequencelist[ 'a', 'b', 123, False ]YES
Sequencetuple( 'a', True, 123 )NO
Sequencerangerange(10) → 0,1,2,...,9NO
Mappingdict{ 'a': 1, 'b' : 2, 'c' : 3 }YES
Setset{ 'a', 'b', 'c' }YES
Setfrozenset({ 'a', 'b', 'c' })NO frozenset({ 'a', 'b', 'c' })
y = { 'a','b','c' }
frozenset(y)
Booleanboolvalues: True, False
x = True
YES variable x is mutable
values True/False are not mutable
Binarybytesb'abc'NO
Binarybytearraybytearray(64)YES/NO complex topic
see documentation for examples
Binarymemoryviewmemoryview(bytes(128))YES/NO complex topic
see documentation for examples

W3schools - Python Data Types