► int
► float
► complex
Integers are zero, positive or negative whole numbers without a fractional part and having unlimited precision.
e.g. 0, 100, -10
e.g. 0.5, 100.2
e.g. 3 + 1j
We can use the type( ) function to know which class a variable or value belongs to and the isinstance( ) function to check if it belongs to a specific class. The good thing is that we can also convert these numbers into another type whenever we require them. If we wanna know the type of the number then for that we can use the type( ) function which returns the type of the number.
Post a Comment
0Comments