Why are Arrays mutable in Python

We can classify Python objects into two major categories i.e mutable and immutable objects. Mutable objects are those which can be changed or modified once they are created whereas immutable objects cannot be altered once they are created.

An array is a data structure in Python that stores a collection of similar types of objects. The objects in an array are indexed by a tuple of positive integers. They can be multi-dimensional and very useful for scientific computing.

Example:

import numpy as np list=[1,2,3,4] arr = np.array(list) print(arr)

**Output**:

[1 2 3 4]