qobjects = [
{
question: "Consider the following code:import numpy as np
arr = np.array(['a', 'b', 'c'])
for x in arr:
print('Hello ' + x)
What will be the printed result?",
options: [
"Hello a b c",
"Hello ['a', 'b', 'c']",
"Hello a"
],
correct: 2
},
{
question: "Consider the following code:
Hello b
Hello cimport numpy as np
arr = np.array([[1, 2, 3], [4, 5, 6]])
for x in arr:
print(x)
What will be the printed result?",
options: [
"[1 2 3]",
"
[4 5 6]1",
"
2
3
4
5
6Array()"
],
correct: 0
},
{
question: "Consider the following code:
Array()import numpy as np
arr = np.array([1, 2, 3, 4, 5, 6, 7, 8])
for x in np.nditer(arr[::2]):
print(x)
What will be the printed result?",
options: [
"1",
"
3
5
72",
"
4
6
83"
],
correct: 0
}
]
4
5
6
7
8