Skip to content

Commit a01f7a9

Browse files
committed
Adding Basic operations on array
1 parent aad1e95 commit a01f7a9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

0007-Array-Functions/array_functions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@
1717
print("After appending:", int_array)
1818

1919
# Removing elements
20-
int_array.remove(3) # Remove an element
21-
print("After removing:", int_array)
20+
int_array.remove(4) # Remove an element
21+
print("After removing:", int_array)
22+
23+
int_array = array.array('i', [2, 4, 6, 8, 10])
24+
25+
# Remove element at index 2 (removes 6)
26+
int_array.pop(2)
27+
print("After removing element at index 2:", int_array)

0 commit comments

Comments
 (0)