Computer Science, asked by vaibhudhano06, 5 months ago

Find the out put of the following program:

import numpy as np

sales=np.array([18000,12000,14900,20000,37000,10500])

print(sales[2:5])

print(sales[:3])​

Answers

Answered by yesiamin6
4

Answer:

[14900 20000 37000]

[18000 12000 14900]

Explanation:

The above one will be the output of your code.

As you used slicing in the program which involves the left number and doesn't involve the right side slice number

So the output will be as follows

In the first print statement it prints from the 2 index value to 4th index value

And in the next print statement it starts printing from 0 index to 2nd index value

{slice[0,n-1} will be the output

THIS IS MY 100TH ANSWER IN THE BRAINLY.

HOPE IT HELPS YOU

DO FOLLOW FOR MORE ANSWERS/PROGRAMS

MARK AS BRAINLIEST

Similar questions