Numbers

Table of Contents

Numeric types include integer, float, and complex—they are among the most commonly used basic types.

Integers

Integers have no decimal point and can be positive or negative. Python 3 has no distinction between short and long integers.

code.python
>>> a = 12
>>> a
12

Python integers have no size limit (no overflow).

Floats

Floats include decimals. For example:

code.python
>>> a = 31.415
>>> a
31.415

When integers and floats are mixed in operations, the result is a float.