Number Types
There are three types of numbers in Python:
- int
- float
- complex
integer int
Integers are numbers that does not have any decimal point.
Such as 1
, 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9
, 10
.
floating number float
Floating numbers are numbers that have decimal point.
Such as 1.0
, 1.1
, 1.2
, 1.3
, 1.4
, 1.5
, 1.6
, 1.7
, 1.8
, 1.9
, 1.10
.
complex number complex
Complex numbers are numbers that have imaginary part.
Such as 1+1j
, 1.0+1.0j
, 1.1+1.1j
, 1.2+1.2j
, 1.3+1.3j
, 1.4+1.4j
, 1.5+1.5j
, 1.6+1.6j
, 1.7+1.7j
, 1.8+1.8j
, 1.9+1.9j
, 1.10+1.10j
.
Here, j
means imaginary part.
It represents √-1
in complex number.