How do I merge a 2D array in Python into one string with List Comprehension?

后端 未结 8 685
囚心锁ツ
囚心锁ツ 2020-12-29 07:49

List Comprehension for me seems to be like the opaque block of granite that regular expressions are for me. I need pointers.

Say, I have a 2D list:

l         


        
8条回答
  •  醉梦人生
    2020-12-29 08:16

    To make it a flattened list use either:

    1. http://code.activestate.com/recipes/121294/
    2. http://code.activestate.com/recipes/363051/

    Then, join to make it a string.

提交回复
热议问题