【发布时间】:2020-10-30 11:24:52
【问题描述】:
我目前正在尝试在 python3 中逐项执行 for 循环。我可能会错过什么?
def add_rows(sq_list):
rowNum = [[0, 0, 0],
[0, 0, 0],
[0, 0, 0]]
for row in rowNum:
total = 0
for column in sq_list[row]:
total += column
print("Row total is:", total)
add_rows([[1, 3, 8],
[2, 4, 6],
[7, 9, 0]])
【问题讨论】:
-
首先你应该在这里输入你的代码,而不是图像。
-
您的预期输出是什么?有什么错误?你为什么用图片而不是在这里输入?
标签: python python-3.x