🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित का आउटपुट क्या होगा?

What will be the output of the following?

import numpy as np
a = np.array([1,5,4,7,8])
a = a + 1
print(a[1])
A)
B)
C)
D)

Explanation:

Let's break down the code:

  1. The array a is created with the values [1, 5, 4, 7, 8].
  2. The operation a = a + 1 increments each element of the array by 1. So, the updated array will be [2, 6, 5, 8, 9].
  3. When print(a[1]) is called, it prints the element at index 1 of the updated array, which is 6.

Thus, the correct output is: (C) 6.

Latest Updates