Commit 6010596b by BellCodeEditor

auto save

parent f445a6e2
Showing with 5 additions and 2 deletions
a=['吕布'] a=['吕布']
b=['袁术','公孙瓒','关羽','张飞','刘备','曹操'] b=['袁术','公孙瓒','关羽','张飞','刘备','曹操']
c=b[2:5] # 取出刘关张 列表c c=b[2:5] # 取出刘关张 列表c 切片
a.extend(c) # 将列表c加入列表a a.extend(c) # 将列表c加入列表a extend
a.pop(1) # 删除a中的关羽 三种方式
a.pop(-3)
a.remove("关羽")
print(a) print(a)
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