saving . . . saved Getting started with list has been deleted. Getting started with list has been hidden .
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 07-05-20, 10:59 a.m. brsolunke79@gmail.com

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]
07-05-20, 11:12 a.m. aditya94palaparthy@gmail.com


Log-in to answer to this question.