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