目录
1.1变量类型
类型 | 描述 | 举例 |
int | 整数 | 123 |
float | 浮点数 | 12.3 12.4e5 |
str | 字符串 | "python" 'Java' |
bool | 布尔型 | True False |
list | 列表 | [1,2,3] |
tuple | 元组 | (1,2,3) |
set | 集合 | {1,2,3} |
dict | 字典 | {1:"Python",2:"Java"} |
注:C中int有限制,Python中int无限制,支持高精度
*查看数据类型 type()
# 查看变量类型 - type()
print(type(123)) # int
print(type(1.23)) # float
print(type(1.24e5)) # 表示1.24 * 10^5 -- float
print(