使用type()函数查看数据类型 2.1
Python
a = 10
b = 3.14
print(type(a)) # 输出:<class 'int'>
print(type(b)) # 输出:<class 'float'>a = 10
b = 3.14
print(type(a)) # 输出:<class 'int'>
print(type(b)) # 输出:<class 'float'>