27 Aug  Admin

Three numeric types in python:

  • int- Integers are whole numbers. They can be positive or negative. They must be without decimal values.
  • float- A floating point number contain decimal points. It can be positive or negative
  • complex- A complex number contains two part – real and imaginary. The imaginary part is written with the “j” suffix.

Example-

a = 4
b = 8.6
c = 2j 
print(type(a))
print(type(b))
print(type(c))
Output-

<class ‘int’>
<class ‘float’>
<class ‘complex’>