【发布时间】:2018-04-06 08:05:15
【问题描述】:
我有以下列表列表():
[[u' why not giving me service'], [u' option to'], [u' removing an'], [u' verify name and '], [u' my credit card'], [u' credit card'], [u' theres something on my visa']]
我有以下问题:
首先,这些u' 出现在我的每个子列表前面是什么?
其次,我怎样才能将我的子列表分成单独的单词,即有这样的东西:
[[why, not, giving, me, service], [option, to], [removing, an], [verify, name, and], [my, credit, card], [credit, card], [theres, something, on, my, visa]]
我已经尝试了split 函数,但我收到以下错误消息:AttributeError: 'list' object has no attribute 'split'
非常感谢。
【问题讨论】:
-
u'表示字符串是unicode。列表没有拆分方法。字符串可以。 -
查找扁平化列表列表
标签: python list split python-2.x