python測試 查看變量類型的python內置函數?
查看變量類型的python內置函數?示例說明:內置函數isinstance(object,(Type1,type2))isinstance(“content”,STR)返回true或false使用內置
查看變量類型的python內置函數?
示例說明:
內置函數isinstance(object,(Type1,type2))
isinstance(“content”,STR)
返回true或false
使用內置函數類型(object)
print(type(1))
print(type(“content”)
output
<type“int”>;return shaping
<type“STR”>#返回字符串