🚀 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( [2, 3, 4, 5] )
b = np.arange(4)
print(a+b)
A)
B)
C)
D)

Explanation:

Sure!

  • a = [2, 3, 4, 5]
  • b = [0, 1, 2, 3] (from np.arange(4))

Adding a and b element-wise:

  • 2 + 0 = 2
  • 3 + 1 = 4
  • 4 + 2 = 6
  • 5 + 3 = 8

So, the result is [2 4 6 8].

Answer: (D) [2 4 6 8].

Latest Updates