DEV Community

Tommi k Vincent
Tommi k Vincent

Posted on

Insertion Operation in Arrays in Python.

insertion is a process of inserting one or more elements into an array,Based on requirement an array can be inserted at the begnining, end or any given index of array.

Enter the code below to to see output:

from array import *

tommi =  array('i',[12,34,56,76,80,90,30])

tommi.insert(1,30)
for x in tommi:
    print(x)
Enter fullscreen mode Exit fullscreen mode

*output *

12
30
34
56
76
80
90
30
Enter fullscreen mode Exit fullscreen mode

Top comments (0)