Python Numbers

Python Numbers
Numbers are used to store the numeric type of data in them. Numbers are the immutable data types i.e. if we change the value of variable then it results in a new type of data. There are three numeric types in Python:

  • int
  • float
  • complex

In python, variables of any type of data type are created when you assign values to them. Variables of numeric types are created when you assign a numeric value to them:
If we want to verify the type of any variable or object in python then we need to use the type() fuction. The type function will give us the data type of the variable or object which is passed as the parameter in the type() function.



An int or integer is a type of combination of the positive and negative whole numbers. An integer is written without decimals.



A float or floating point number is a combination of the positive or negative numbers with one or more decimal points.



A complex number is a number which is combination of the real and imaginary part and the real and imaginary parts are distinguihed from each other with 'j' and they are written in the form of 'a+jb' where 'a' represent the real part and b represent the imaginary part.