基础数据类型(一)—— 数值类型
一、数据类型分类
1. 数值类型
1.1 整数(int)
a = 10 # 使用赋值运算符‘=’给a赋值
print(type(a)) # print()函数进行输出,type()函数获取a的类型,输出a的类型
<class 'int'>
1.2 浮点数(float)
a = 1.1
print(type(a))
<class 'float'>
1.3 复数(complex)
a = 10.3+9j
print(type(a))
<class 'complex'>
2. 序列类型
2.1 字符串(str)
2.2 列表(list)
2.3 元祖(tuple)
3. 散列类型
3.1集合
3.2 字典(dict)
4.其他类型
4.1 布尔值(bool)
4.2 为空(