निम्नलिखित कोड का परिणाम क्या है ?
What is the output of the following code ?
import numpy as np
a = np.array([[1,2,3]])
print(a.shape) A
(2, 3)
B
(3, 1)
C
(1, 3)
D
None of these
Explanation
Let's break it down:
-
Array
a:a = np.array([[1, 2, 3]])This creates a 2D array with one row and three columns:
[[1, 2, 3]] -
Shape of
a:print(a.shape)The shape of
ais(1, 3)because it has 1 row and 3 columns.
Output: (1, 3)
Answer: (C) (1, 3)
Correct Answer: C) (1, 3)