The numeric types for Python are:
- integers (
int
)
Examples:
print(1)
print(100)
print(8435367)
- floating point numbers (
float
)
Examples:
print(1.5)
print(46.84)
print(84357.435)
- complex numbers
Examples:
print(3 + 4j)
print(5 + 6j)
print(2j + 1)
The standard library adds numeric types for
Numeric objects are created from literals or as the result of functions and operators. The syntax for numeric literals is well documented.