s = ('hi my name is, huh', ' ', '', 'my name is, what', 'my name is harry potter')
and turn it into:
l = ['hi my name is, huh', ' ', '', 'my name is, what', 'my name is harry potter']
我有一堆字符串,如何将它们列入列表而没有单独的单词列表?
答案 0 :(得分:1)
使用list
。
>>> s = ('hi my name is, huh', ' ', '', 'my name is, what', 'my name is harry potter')
>>> list(s)
['hi my name is, huh', ' ', '', 'my name is, what', 'my name is harry potter']