Getting started with list
Title
Question
How can we insert new element in the middle of list instead of at the end?
Is there any function to insert at any position in the list?
Python-3.4.3 Getting-started-with-Lists 01-02 min 10-20 sec
Answers:
You can use the listinsert(position, value)function.
For e.g L = [1, 2, 4]
L.insert(2, 3)
This will make the list L as [1,2,3,4]
Login to add comment