首页后端开发Python查看变量类型的python内置函数

查看变量类型的python内置函数

时间2023-06-03 17:23:02发布访客分类Python浏览606
导读:查看变量类型的python内置函数?示例说明:内置函数isinstance(object, (type1,type2… isinstance('content', str 返回True or False使用内置函数type(object ...

查看变量类型的python内置函数?

示例说明:

内置函数isinstance(object, (type1,type2…))

isinstance('content', str)

返回True or False

使用内置函数type(object)

print(type(1))

print(type('content'))

输出

type 'int'> #返回整形

type 'str'> #返回字符串

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: 查看变量类型的python内置函数
本文地址: https://pptw.com/jishu/59938.html
python网络数据采集常用什么库 物联网大数据LinuxPython

游客 回复需填写必要信息