Web Analytics

Python list.insert() Method

List Method Insert

The insert() method inserts the specified value at the specified position.

Syntax

list.insert(pos, elmnt)

Parameters

Parameter Description
pos Required. A number specifying in which position to insert the value
elmnt Required. An element of any type (string, number, object etc.)

Return Value

None. The list is modified in place.

Example

Using the insert() method:

Output
Click Run to execute your code

Related Functions