import numpy as np # Create a numpy array arr = np.array([1, 2, 3, 4, 5]) # Make the array read-only using the flags attribute arr.flags.writeable = False # Try to modify the array - this will raise a ValueError arr[0] = 10