尝试从 2D 列表中删除字符串,但仅在第一列中
我的尝试:
list = [[x.strip('this') for x in y[0]] for y in list]
示例列表:
[["apple this","juice this"], ["orange this","lemonade this"], ["kiwi this","punch this"]]
想要的结果:
[["apple","juice this"], ["orange","lemonade this"], ["kiwi","punch this"]]
只从第一列而不是第二列剥离“this”。
最好甚至不检查其他列。
慕尼黑8549860
慕侠2389804
POPMUISE
慕莱坞森
相关分类