Python List insert()方法

Python List insert()方法

Python 列表 Python 列表


描述

insert() 函数用于将指定对象插入列表的指定位置。

语法

insert()方法语法:

list.insert(index, obj)

参数

  • index -- 对象 obj 需要插入的索引位置。
  • obj -- 要插入列表中的对象。
posted @ 2020-07-01 20:22  酸辣土豆皮  阅读(401)  评论(0编辑  收藏  举报