Adding Elements to Lists : List Insert « List « Python






Adding Elements to Lists

Adding Elements to Lists

li = ['a', 'b', 'mpilgrim', 'z', 'example'] 

li.insert(2, "new")                                

print li 


           
       








Related examples in the same category

1.List insert(i, x)List insert(i, x)