Print list of lists in separate lines

后端 未结 6 1881
生来不讨喜
生来不讨喜 2020-12-01 10:15

I have a list of lists:

a = [[1, 3, 4], [2, 5, 7]]

I want the output in the following format:

1 3 4
2 5 7
<
6条回答
  •  忘掉有多难
    2020-12-01 10:20

    a = [[1, 3, 4], [2, 5, 7]]
    for i in a:
        for j in i:
            print(j, end = ' ')
        print('',sep='\n')
    

    output:

    1 3 4
    2 5 7
    

提交回复
热议问题