05-Number Data Type
05-Number Data Type
Number data types store numeric values. Number objects are created when you
assign a value to them. For example-
var1 = 1
var2 = 10
You can also delete the reference to a number object by using the del statement.
The syntax of the del statement is −
You can delete a single object or multiple objects by using the del
del var
del var_a, var_b
int (signed integers): They are often called just integers or ints. They
are positive or negative whole numbers with no decimal point. Integers in
Python 3 are of unlimited size. Python 2 has two integer types - int and
long. There is no 'long integer' in Python 3 anymore.
float (floating point real values) : Also called floats, they represent
real numbers and are written with a decimal point dividing the integer and
the fractional parts. Floats may also be in scientific notation, with E or e
indicating the power of 10 (2.5e2 = 2.5 x 10 2 = 250).