相关疑难解决方法(0)

如何比较Python中对象的类型?

基本上我想这样做:

obj = 'str'
type ( obj ) == string
Run Code Online (Sandbox Code Playgroud)

我试过了:

type ( obj ) == type ( string )
Run Code Online (Sandbox Code Playgroud)

它不起作用.

另外,其他类型呢?例如,我无法复制NoneType.

python types compare

152
推荐指数
9
解决办法
20万
查看次数

标签 统计

compare ×1

python ×1

types ×1