我想在python3上这样打印
[1, 2, 3] [3, 2, 1] [4, 4, 4]
[4, 5, 6] + [6, 5, 4] = [10, 10, 10]
[7, 8, 9] [9, 8, 7] [16, 16, 16]
但是它显示如下:
[1, 2, 3]
[4, 5, 6]
[7, 8, 9]
+
[3, 2, 1]
[6, 5, 4]
[9, 8, 7]
=
[4, 4, 4]
[10, 10, 10]
[16, 16, 16]
这是我的代码: https://codeshare.io/29rgr7
答案 0 :(得分:1)
您可以在python3中传递vargs参数ot打印方法,这正是您想要的
print([1, 2, 3], [3, 2, 1], [4, 4, 4])
print([4, 5, 6], '+', [6, 5, 4], '=', [10, 10, 10])
print([7, 8, 9], [9, 8, 7], [16, 16, 16])