python map string split list

后端 未结 5 694
盖世英雄少女心
盖世英雄少女心 2021-01-30 09:13

I am trying to map the str.split function to an array of string. namely, I would like to split all the strings in a string array that follow the same format. Any id

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-30 09:32

    map(lambda x: x.split(), a) but, using a list comprehension [x.split() for x in a] is much clearer in this case.

提交回复
热议问题