📜  python如何将字符串添加到中间的列表中 - Python代码示例

📅  最后修改于: 2022-03-11 14:47:13.976000             🧑  作者: Mango

代码示例1
listexample['exampleone', 'examplethree']
listexample.insert(1, 'exampletwo')
print(listexample)
#prints ['exampleone', 'exampletwo', 'examplethree']
#Use the insert() method when you want to add data to the beginning or middle of a list. 
#Take note that the index to add the new element is the first parameter of the method.