Python3 基本数据类型

python3 中有6个标准数据类型:

数字:int、float、bool、complex

字符串:str

列表:list 

元组:tuple 

集合:set 

字典:dict

可变数据类型:list、set、dict

type():查看数据类型

>>> a = 1
>>> type(a)
<class 'int'>

isinstance():判断数据类型

>>> a = 'hello'
>>> isinstance(a, str)
True

 

posted @ 2018-11-25 21:52  每天的成长  阅读(123)  评论(0编辑  收藏  举报