一、元组的创建
1. 元组(tuple):不可变数据类型 ,元组内可以存储任意数据类型
t = (1,2.3,True,'westos') #整型、浮点型、布尔型、字符型
print(t)
print(type(t))
2. 元组中可以嵌套列表
t1 = ([1,2,3],4)
print(t1)
t1[0].append(4) ##元祖不可变,但其中list元素可变
print(t1)
t2 = ('westos') #字符串类型
print(type(t2))
t2 = ('westos',) #元组类型
print(type(t2))
二、元组的特性
1. 索引 切片
users = ('root&