type of python variable code example
Example 1: print variable type python
v = 10
type(v)
# <type 'int'>
Example 2: type in python
numbers_list = [1, 2]
print(type(numbers_list))
numbers_dict = {1: 'one', 2: 'two'}
print(type(numbers_dict))
class Foo:
a = 0
foo = Foo()
print(type(foo))
Output
<class 'dict'>
<class 'Foo'>
<class '__main__.Foo'>