Commit d6040aae by BellCodeEditor

auto save

parent c593e827
Showing with 18 additions and 0 deletions
...@@ -2,3 +2,20 @@ ...@@ -2,3 +2,20 @@
a= ['华雄'] a= ['华雄']
a.append('颜良','文丑') a.append('颜良','文丑')
print(a) print(a)
'''
# 列表中删除元素的方法:
1. 列表名.pop() 用来删除指定位置的元素,括号里填要删除元素的索引值
2. remove() 用来删除某一个元素,括号里填要删除的那个元素
#列表中增加元素的方法:
1. 列表名.insert(索引,内容) 在指定位置插入元素
2. 列表名.append(内容) 在列表末尾增加元素,只能增加一个
3. 列表名.extend(列表) 在列表末尾追加多个元素
'''
\ 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