Python type()内置函数 --判断数据类型 发表于 2020-09-22 分类于 Python type() 函数是用来查询数据类型,只有知道属于什么对象,才能使用该对象的方法和属性 一些例子12345print(type('雨园博客'))print(type(1314))print(type(88.88))print(type(['雨园博客', 1314, 88.88]))print(type({'雨园': '博客', 13: 14})) 输出 12345<class 'str'><class 'int'><class 'float'><class 'list'><class 'dict'> 类型说明 str : 字符串int : 整数float : 浮点数list : 列表dict : 字典