🚀 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 it down:

  1. You have an array a = np.array([1, 5, 4, 7, 8]).
  2. Then, you add 1 to each element of the array: a = a + 1. This results in a = [2, 6, 5, 8, 9].
  3. The code then prints a[1], which is the element at index 1 in the array. After the addition, a[1] is 6.

So, the correct answer is:

(C) 6.

Latest Updates