为什么与map函数关联的res1 返回结果是 [None, None, None] ??
来源:4-1 如何拆分含有多种分隔符的字符串

慕勒2572366
2018-09-21
代码如下:
s = ‘ab;cd|efg|hi,jkl|mn\topq;rst,uvw\txyz’
res = s.split(’;’)
t = []
res1 = list(map(lambda x: t.extend(x.split(’|’)), res))
res = t
print(res) # 返回结果: [‘ab’, ‘cd’, ‘efg’, ‘hi,jkl’, ‘mn\topq’, ‘rst,uvw\txyz’]
print(res1) # 返回结果: [None, None, None]
写回答
1回答
-
ImoocZhang
2018-12-13
建议同学需要先学习下python语法基础了
00
相似问题