【发布时间】:2020-06-22 10:32:46
【问题描述】:
我有一个列表,如果它与一个单词和一个半列匹配,我想将它的项目拆分为自己的部分。当您查看以下代码和期望的结果时,这将更有意义。
list = [
'Size: 20inches. Weight: about 1.2kg',
'Length: pretty long. Body: is plastic.',
'For all ages. Comes with box'
]
期望的结果:
list = [
'Size: 20inches.',
'Weight: about 1.2kg',
'Length: pretty long.',
'Body: is plastic.',
'For all ages. Comes with box'
]
【问题讨论】:
标签: python-3.x list split