Last answered:

04 Oct 2019

Posted on:

04 Oct 2019

0

How do we add new elements in the list at a particular position in the list?

1 answers ( 0 marked as helpful)
Instructor
Posted on:

04 Oct 2019

0
Hi Sayed!   Great to have you in the course and thanks for reaching out!   You can use the .insert() method to do that. The syntax structure to follow is list_name.insert(index, element). I.e., in the list called list_name, this will insert element in the given index, shifting the elements to the right.   Hope this helps. Best,
Martin

Submit an answer