Python编程:NameError: name 'reduce' is not defined

问题来了 使用 reduce() 测试的时候报错:reduce 未定义!python print(reduce(lambda x, y: x + y, [ 1, 2, 3])) """Output: NameError: name 'reduce' is not defined """ 解决 引用stackoverflow的回答: - 你使用的是python3 - 参考的是python2的指南w
相关文章
相关标签/搜索