print two dimensional list

后端 未结 7 2675
[愿得一人]
[愿得一人] 2021-02-20 14:46

I have a list, in which is another list and I want to doc.write(a)

a = [[1, 2, \"hello\"],
     [3, 5, \"hi There\"],
     [5,7,\"I don\'t know\"]]
         


        
相关标签:
7条回答
  • 2021-02-20 15:27

    You can also just use a simple list comprehension like this:

    doc.write([x for x in i for i in a])
    
    0 讨论(0)
提交回复
热议问题