0
按行和列打印2维列表mult_table。使用嵌套循环。给定程序的示例输出(每行之间没有间隔):按行和列打印2维列表
1 | 2 | 3
2 | 4 | 6
3 | 6 | 9
这是我的代码:我尝试使用嵌套循环,但我有我的输出在底部。它有额外的|最后
for row in mult_table:
for cell in row:
print(cell,end=' | ')
print()
1 | 2 | 3 |
2 | 4 | 6 |
3 | 6 | 9 |
“|”.join(行中单元格的[str(单元格)]) – j449li