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 173 views
1 answer 180 views
1 answer 97 views
1 answer 74 views
1 answer 87 views
1 answer 181 views
1 answer 186 views
...