Python中查看变量数据类型

内置函数isinstance(object, (type1,type2…)) isinstance('content', str) 返回True or Falseweb 使用内置函数type(object) print(type(1)) print(type('content')) 输出bash <type 'int'> #返回整形 <type 'str'> #返回字符串
相关文章
相关标签/搜索