निम्नलिखित का आउटपुट क्या होगा?
What will be the output of the following ?
import numpy as np
print(np.minimum([2, 3, 4], [1, 5, 2])) A
[1 2 5]
B
[1 5 2]
C
[2 3 4]
D
[1 3 2]
Explanation
Let's analyze the given code:
import numpy as np
print(np.minimum([2, 3, 4], [1, 5, 2]))
Explanation:
np.minimum(a, b)compares two arrays element-wise and returns a new array containing the smaller value for each corresponding pair of elements.- In this case, we have two lists:
[2, 3, 4][1, 5, 2]
Comparing elements:
min(2, 1)→1min(3, 5)→3min(4, 2)→2
So, the result is [1, 3, 2].
Output:
(D) [1 3 2]
Correct Answer: D) [1 3 2]