查看变量类型的python内置函数
导读:查看变量类型的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
