Problem 3: Select Specific Elements Using Fancy Indexing
Easypython
Problem Description
Write a Python program that selects elements at specific given index positions from an array using fancy indexing.
Input
An array and a list of index positions.
Output
The selected elements, in the specified order.
Constraints
- Index positions must be valid for the array's length.
Example Input
textarray=[10,20,30,40,50], indices=[4,0,2]
Example Output
textSelected: [50 10 30]
Concepts Covered
Fancy indexing.