Step-by-Step Explanation
✅ Line 1:
-
This imports Python's built-in array module, which provides an efficient way to store numeric data of the same type.
✅ Line 2:
-
Creates an array of type 'i', which means signed integer.
-
Initial array:
✅ Line 3:
-
The .pop(1) method removes the element at index 1.
-
So it removes the value 10.
-
Array becomes:
✅ Line 4:
-
Accesses the element at index 1 of the updated array.
-
Now, arr[1] = 15, so this line prints:
✅ Final Output:


0 Comments:
Post a Comment