我的字符串如下:
a =' sruthi'
我想将此字符串转换为如下所示的列表:
[' sruthi']
任何人都可以帮我吗?
答案 0 :(得分:0)
a ='sruthi'
result = a.split()
print result
o / p:['sruthi']
答案 1 :(得分:0)
>>> a ='sruthi'
>>>
>>> list([a])
['sruthi']
>>>
或者喜欢上面的评论...
>>> a ='sruthi'
>>> a = [a]
>>> a
['sruthi']
选择你的味道......
答案 2 :(得分:0)