我正在学习 map、filter 和 reduce 函数。在做练习时,我想知道是否可以用 map 函数来编写它,我搞砸了一点,但我无法找到解决方案。这可能吗?任何帮助,将不胜感激。
for f in words:
a = words.index(f)
final_dict[str(words[a])] = len(pre[a])
words 是单词列表,pre 是列表列表。
我正在学习 map、filter 和 reduce 函数。在做练习时,我想知道是否可以用 map 函数来编写它,我搞砸了一点,但我无法找到解决方案。这可能吗?任何帮助,将不胜感激。
for f in words:
a = words.index(f)
final_dict[str(words[a])] = len(pre[a])
words 是单词列表,pre 是列表列表。