Python List insert() method

The list.insert () method in Python inserts an item at the specified position.

Syntax

Parameter

i: This parameter represents a number specifying the position to insert the given value.

x: This parameter signifies an element of any type (string, number, object etc.)

Example 1

Output

Example 2

Output

Pin It on Pinterest

Share This