Data types

A data type is defined by a set of values and a set of rules we can apply to it.

Everything in python is a class. To find it, you can use the type function.

>>> type(True)
<class 'bool'>
>>> type(1)
<class 'int'>
>>> type("what is this?")
<class 'str'>
>>> a = 2
>>> type(a)
<class 'int'>