Source Code:
(back to article)
import array as arr # create an array of integers my_array = arr.array('i', [1, 2, 3, 4, 5]) # change the value of an element in the array my_array[2] = 10 # print the updated array print(my_array) # Output: array('i', [1, 2, 10, 4, 5])
Result:
Report an issue