如何将字符串转换为python中的列表,例如:'LIFE IS FULL'
到['LIFE','IS','FULL']
答案 0 :(得分:5)
使用str.split()
:
>>> strrs="LIFE IS FULL"
>>> strrs.split()
['LIFE', 'IS', 'FULL']
答案 1 :(得分:1)
您可以使用.split
方法:
a = "LIFE IS FULL"
b = a.split()
['LIFE','IS','FULL']