Sunday, 29 December 2019

Datatype of int , float and bool in python.


we all know that datatype of whole numbers is int
print(type(3))
output : class int


and the datatype of True is boolean
print(type(True))
output : class bool


and the datatpye of decimal numbers is float print(type(5.5))
output : class float


The type of int , float and bool in python is class "type", class type is defined in python library. Also called as metaclass. It is called metaclass because it helps to create the object of int, float and bool (and other datatypes)
print(type(int))
print(type(float))
print(type(bool))

output : class 'type'