Python Programming - Arrays - Discussion

Discussion Forum : Arrays - General Questions (Q.No. 35)
35.
Given a NumPy array arr = np.array([3, 1, 4, 1, 5, 9]), what does the code arr[::-1] do?
Reverses the order of elements in the array.
Selects only the even-indexed elements.
Creates a new array with the same elements.
Removes the last element from the array.
Answer: Option
Explanation:
The code arr[::-1] reverses the order of elements in the array.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.