python中怎么查看数据类型
在Python中,可以使用type()函数来查看数据的类型。
例如:
x = 5
print(type(x)) # 输出:<class 'int'>
y = "Hello"
print(type(y)) # 输出:<class 'str'>
z = [1, 2, 3]
print(type(z)) # 输出:<class 'list'>
通过调用type()函数并传入要查看类型的变量,即可获取该变量的数据类型。
阅读剩余
THE END