python怎么在列表中插入元素 2020/1/282020/1/27 作者 admin sitelist = ['baidu','ali','tencent'] #输出为 sitelist = ['baidu','chiplayout','ali','tencent']
>>> sitelist = ['baidu','ali','tencent'] >>> sitelist.insert(1,'chiplayout') >>> print(sitelist) ['baidu', 'chiplayout', 'ali', 'tencent'] 回复
>>> sitelist = ['baidu','ali','tencent']
>>> sitelist.insert(1,'chiplayout')
>>> print(sitelist)
['baidu', 'chiplayout', 'ali', 'tencent']