使用内置函数type()
a, b, c, d = 20, 5.5, True, 4+3j
print(type(a), type(b), type(c), type(d))
得到结果
<class'int'> <class'float'> <class'bool'> <class'complex'>
使用内置函数type()
a, b, c, d = 20, 5.5, True, 4+3j
print(type(a), type(b), type(c), type(d))
得到结果
<class'int'> <class'float'> <class'bool'> <class'complex'>