What is the value of count after the following commands? c = np.array([[6, 1, 4], [2, 1, 5], [3, 7, 1]]) n = len(c) count = 0 for i in range(n): for j in range(n): if i==j and c[i,j]==1: count += 1单项选择题

A
a. 0
B
b. 1
C
c. 2
D
d. 3
E
e. Undefined
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
What is the value of j after three iterations of the following loop? j = np.linspace(0,20,5); for m in range(len(j)): j[m] = j[m]*2;
What is the value of z after the following commands? import numpy as np x = 1 y = 1 z = np.zeros(1) while y < 4: z = np.append(z, 0) z[x] = 2 * y x = x + 1 y = y + 2
A file which contains only one row of data is imported using np.genfromtxt() and is assigned to X. Which of the following is true?
What is the value of a after the running the following commands? import numpy as np sqr = lambda x: x**2 a = sqr(np.arange(1,6))
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!