Question: 9 . 1 2 NumPy: Slicing arrays Write a program to prompt the user to enter integers and then adds them to a list (

9.12 NumPy: Slicing arrays
Write a program to prompt the user to enter integers and then adds them to a list (hint: use a loop here). Then convert the list to a NumPy array. Then find and print a subset of the array that contains the given indexes.
For example:
the printed list would be:
?'1',2',3',4',5'
and the printed ndarray array would be:
1,2,3,4,5
NOTE: The list contains strings and the array contains int's. You will need to declare a type when converting a list to an ndarray.
Finally, output the substring of the array for the given index(es).
For example:
Enter the starting index: 2
Enter the ending index: 4
the printed subset would be: cdots[3,4]
539078.3140466.q3zqy7
LAB
9.12.1: NumPy: Slicing arrays
020
ACTIVITYWhen done developing your program, press the Submit for grading button below. This will submit your program for auto-grading.
Coding trail of your work What is this?
415m0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0min:15.
Latest submission -10:42 PM EDT on 04/15/24
Total score: 020
1:Compare output
010
Output differs. See highlights below. Special character legend
Expected output
2.Compare output
010
Output differs. See highlights below. Special character legend
Input
\table[[2],[14],[23],[15],[7],[9],[11],[15],[3],[0],[5],[8]]Expected output
9 . 1 2 NumPy: Slicing arrays Write a program to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!