为什么这样会提示TypeError: list indices must be integers or slices, not list,求大佬解答!感谢
area = 1
L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for i in L:
for j in L:
area *= L[i][j]
print("第{}个长方形的体积为{}".format(i,area))
area = 1
area = 1
L = [[1, 2, 3], [5, 3, 2], [7, 3, 2]]
for i in L:
for j in L:
area *= L[i][j]
print("第{}个长方形的体积为{}".format(i,area))
area = 1
2021-09-15
举报