Hello All, I am new in this community and I am in learning face, I want to know the output syntax of deleting elements from an Array in Python. I have mention the input format but i don’t know about the final output. Can anyone suggest me.
import array as ar1 number = ar1.array('i', [11, 22, 33, 33, 44]) del number # removes the third element print(number) del number # deletes the entire array print(number)
Best answer by rohanjoshi0894
Just review this code and if you want to know more about Python Array.
import array as arr
number = arr.array('i', [1, 2, 3, 3, 4])
del number # removing third element
print(number) # Output: array('i', [1, 2, 3, 4])
del number # deleting entire array
print(number) # Error: array is not defined