Python 3 教程
Python3 列表
insert() 函數(shù)用于將指定對象插入列表的指定位置。
insert()方法語法:
list.insert(index, obj)
該方法沒有返回值,但會在列表指定位置插入對象。
以下實例展示了 insert()函數(shù)的使用方法:
以上實例輸出結(jié)果如下:
列表插入元素后為 : ['Google', 'Baidu', 'Runoob', 'Taobao']