int 整形
float 浮点型
str 字符串
bool 布尔类型
# bool 类型
a = True
aa = False
print(type(a))
list 列表
b = [10, 20, 30]
print(type(b))
tuple 元组
# tuple -- 元组
c = (10, 20, 30)
print(type(c))
set 集合
# set -- 集合
d = {10, 20, 30}
print(type(d))
dict 字典
# dict -- 字典
e = {'name': 'tom', 'age': 18}
print(type(e))
本文将深入介绍Python中的四种基本数据类型(整数、浮点数、字符串和布尔)、列表、元组、集合和字典等容器,帮助读者理解它们的特性和使用场景。
4863

被折叠的 条评论
为什么被折叠?



