Basic types

Python's basic types are int (integers), float (decimals), str (text), bool (true/false) and None (absence of value). The type of a value determines the possible operations, and type() lets you inspect it. Conversions are done explicitly with int(), float() or str().

Example

int('42') + 1   # 43
type(3.14)      # <class 'float'>

Related concepts

The whole glossary