how to check a variable of a type in python code example
Example 1: how to check the type of a variable in python
print(type(x))
Example 2: how to check if a variable in python is a specific data type
isinstance(variable_name, class_name) #eg. isinstance(age, int) will return True