Commit 6fe820ef by BellCodeEditor

auto save

parent da808c4c
Showing with 10 additions and 2 deletions
......@@ -4,4 +4,12 @@
#这时还是无名小卒的关羽上前请战,请从b列表中删掉“关羽”,用三种方法哦。
b=['袁术','夏侯惇','曹操','关羽']
b.pop(3)
\ No newline at end of file
#b.pop(3)
#b.pop(-1)
b.remove('关羽')
print(b)
# 列表名.pop() 用来删除指定位置的元素,括号里填要删除元素的索引值
# remove() 用来删除某一个元素,括号里填要删除的那个元素
# 列表中增加元素的方法:
1. 列表名.insert(索引,内容) 在指定位置插入元素
2. 列表名.append(内容) 在列表末尾增加元素
\ 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