Commit 745fe71d by BellCodeEditor

auto save

parent bd6c17fa
Showing with 0 additions and 19 deletions
......@@ -7,21 +7,3 @@ b=['袁术','夏侯惇','曹操','关羽']
# 删除列表中的关羽
# 方法一使用b.remove()方法
b.remove('关羽')
# 方法二使用b.pop(3)
# 方法三使用b.pop(-1)
# 打印出列表b
print(b)
a = ['华雄'] # 创建列表a,华雄
# 将关羽填到a列表中
# 方法一用insert()方法
a.insert(1, '关羽')
# 方法二用append('关羽')方法
# 打印出列表a
print(a)
a = ['华雄']
c = ['颜良','文丑']
# 用extend()方法将列表c内容填到列表a
a.extend(c)
# 打印出列表a
print(a)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment