Python list.insert() Method
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
Enjoying these tutorials?