Python Numbers
Python Numbers
In Python, numbers are of the following data types:
- int
- float
- complex
int
int is a positive or a negative integer of any length. int should not be a decimal or a fraction.
Example:
Output:
Float
A float is a positive or a negative decimal number. It can be an exponential number or a fraction.
Example:
Output:
complex
Complex numbers are a combination of real and imaginary number. They are of the form a + bj, where a is the real part and bj is the imaginary part.
Example:
Output: