Skip to content

Commit 7b5f758

Browse files
committed
del int array
1 parent a01f7a9 commit 7b5f758

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

0007-Array-Functions/array_functions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,11 @@
2525
# Remove element at index 2 (removes 6)
2626
int_array.pop(2)
2727
print("After removing element at index 2:", int_array)
28+
29+
int_array = array.array('i', [2, 4, 6, 8, 10])
30+
31+
# Alternatively, we can use `del`
32+
del int_array[1] # Removes element at index 1 (2)
33+
print("After using del to remove element at index 1:", int_array)
34+
35+

0 commit comments

Comments
 (0)