我可以打印没有括号的列表吗?

时间:2017-07-08 18:24:30

标签: python python-3.x printing

from itertools import product
A=((1,2),(3,4))
B= list(product(*A)) 
print (B)   

我的输出是

[(1, 3), (1, 4), (2, 3), (2, 4)] 

但我想要我的输出

(1, 3) (1, 4) (2, 3) (2, 4)

1 个答案:

答案 0 :(得分:1)

只需使用:

print (*B)

输出:

(1, 3) (1, 4) (2, 3) (2, 4)
相关问题