Python program to find the variable using type casting

A Python program to find the variable type. In this program we can print the variable in python programming language. 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 = 5
y = "inlarn"
z=5.4
print(type(x))
print(type(y))
print(type(z))

 

Output:

<class ‘int’>
<class ‘str’>
<class ‘float’>