python列表、元组
1.列表(重点)
1.1 添加
1.1.1 末位追加
语法:列表 . append(数据)
例如:
score=[60,79,90] #成绩的裂变
score.append(99) #将99追加到最后
print(score)
运行结果:
[60,79,90,99]
1.1.2 插入
语法:列表 . insert(索引,数据)
例如:
score=[60,79,90] #成绩的裂变
score.insert(2,99) #将99插入到索引为2的位置
print(score)
运行结果:
[60,79,99,90]
1.1.3 扩展
将列表2的数据追加到列表
语法:列表 . extend(列表2)
例如:
scoer=[60