混乱的四种类型
1.1 列表
设置变量
List1 = ['11','22','33','44']
print(List1[0])
1.2 元组
tup1 = ('Google', 'Runoob', 1997, 2000)
print(tup1)
1.3 字典
dict = {'Name': 'Runoob', 'Age': 7, 'Class': 'First'}
print("dict['Name']: ", dict['Name'])
print(type(dict))
1.4 集合
basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
print(type(basket))
ss = set(("google","lenovo","sss"))
print(type(ss))
|