1.添加元素

(1)append

Python列表常见操作

Python列表常见操作


(2)extend

Python列表常见操作

Python列表常见操作


(3)insert

Python列表常见操作

Python列表常见操作


2.修改元素

Python列表常见操作

Python列表常见操作


3.查找元素

(1)in,not in

Python列表常见操作

Python列表常见操作


(2)index

list.index(element,start=0,end=len(list))----参考字符串中index的使用

Python列表常见操作


(3)count

list.count(element,start=0,end=len(list))

Python列表常见操作


4.删除元素

(1)del:根据下标进行删除

Python列表常见操作


(2)pop:删除最后一个元素

Python列表常见操作


(3)remove:根据元素的值进行删除

Python列表常见操作


5.排序

Python列表常见操作

相关文章:

  • 2022-01-02
  • 2021-09-08
  • 2022-01-29
  • 2021-06-03
  • 2021-06-30
  • 2021-10-16
猜你喜欢
  • 2021-10-16
  • 2022-12-23
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案