列表(list)
1、有序、可变、 允许重复
2、常用功能
1)索引
c = ['s','d,'f']
print(c[1])
print(c[-3])
2) 长度
c = ['s', 'd, 'f']
print(len(c))
3) 切片
c = ['s', 'd', 'f']
print(c[:3])
print(c[-3:-1])
4) 循环
c = ['s', 'd' ,'f']
c.sort()
c.reverse()
5) 增
L = ['a', 'b', 'c']
# 追加:append、
# 批量追加:extend
# 插入:insert
L.append('d')
print(L)
L2 = [1, 2, 3]
L.extend(L2)
print(L)