इसका आउटपुट क्या है:
what is the output of:
import numpy as nd
x= nd.array([2,3,4,10,12,14,18])
print(x[:3])
A)
B)
C)
D)
Explanation:
The slice x[:3]
gets the elements from index 0 to 2, which are [2, 3, 4]
.
Answer: (B) [2 3 4]