Observe the following code and identify what will be the outcome (1)?

6. Observe the following code and identify what will be the outcome?

import numpy as np

a=np.array([1,2,3,4,5,6])

print(a)
  1. [1 2 3 4 5]
  2. [1 2 3 4 5 6]
  3. [0 1 2 3 4 5 6]
  4. None of the mentioned above

Answer: B) [1 2 3 4 5 6]

Explanation:

In the above code, an array of six elements declared and assign it to the variable a. In the next line of code, a is printing. So, all the elements which are in array a will be print on screen.

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.