Python program to print the number type like int float or complex

A Python program to print the number type like int float or complex. We can easily find the type of number using type casting method in python. Type casting is a technique for converting variables/values declared in one data type to a different data type in order for the code snippet to conduct the action necessary. This feature can be achieved in Python by using function Object()  functions such as int(), string(), float(), and so on.

x = 10
y = 28.2
z = 1j
print(type(x))
print(type(y))
print(type(z))

 

Output:

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