Python List insert() Method

Python List insert() Method

  • The insert() method inserts an element to the list at a given index.

Syntax

  • list.insert(index, element)

Parameter Values

The insert() function takes two parameters:

  • index - position where an element needs to be inserted.

  • element - this is the element to be inserted in the list.

 


 

 

 

 

 

Comments