python中常用的数据类型
1.整型(int)
a = 100
2.浮点型(flaot)
b = 10.00
3.复数(complex)
c = 10 + 3j
10 + 3j 等价于10i + 3j,Python中需要将i省略4.布尔值(bool)
d = True
5.空值(NoneType)
e = None
6.字符串(str)
f = ‘abcde’
7.列表(list)
g = [1,2, 3, ‘a’]
8.元组(tuple)
h = (1, 2, 3, ‘a’)
9.集合(set)
i = {1, 2, 3}
10.字典(dict)
{‘name’:‘张三’, ‘age’:20}
如果想知道一个数据是什么类型,可以用type方法
例如: