typeof不是Python内置函数,正确的是使用type函数来获取对象的类型。type函数的作用是返回一个对象的类型。例如:
x = 5print(type(x))# <class 'int'>y = "Hello"print(type(y))# <class 'str'>z = [1, 2, 3]print(type(z))# <class 'list'>上一篇:java中timertask的作用是什么
下一篇:docker中怎么安装mongo并测试
python
typeof不是Python内置函数,正确的是使用type函数来获取对象的类型。type函数的作用是返回一个对象的类型。例如:
x = 5print(type(x))# <class 'int'>y = "Hello"print(type(y))# <class 'str'>z = [1, 2, 3]print(type(z))# <class 'list'>