What are Arrays in Python?

A collection of items stored in contiguous memory spaces is referred to as an array. The objective is to group together goods of the same type. This makes calculating the position of each element easy by simply adding an offset to a base value, such as the memory location of the array’s first element (generally denoted by the name of the array).

Example:

# Python program to demonstrate
# Creation of Array
 
# importing "array" for array creations
import array as arr
 
# creating an array with integer type
a = arr.array('i', [1, 2, 3])
 
# printing original array
print ("The new created array is : ", end =" ")
for i in range (0, 3):
    print (a[i], end =" ")
print()
 
# creating an array with float type
b = arr.array('d', [2.5, 3.2, 3.3])
 
# printing original array
print ("The new created array is : ", end =" ")
for i in range (0, 3):
    print (b[i], end =" ")
    

Output : 
The new created array is :  1 2 3 
The new created array is :  2.5 3.2 3.3