How to add new (insert) element to list at a specific index in Python

1 Answer

0 votes
programming = ['Python', 'Java', 'C#', 'C', 'PHP']

programming.insert(2, "C++")

print(programming)

'''
run:

['Python', 'Java', 'C++', 'C#', 'C', 'PHP']

'''

 



answered Sep 22, 2017 by avibootz

Related questions

1 answer 196 views
1 answer 213 views
1 answer 125 views
1 answer 96 views
1 answer 111 views
1 answer 204 views
1 answer 212 views
...