关于map 或者 filter 两个变量的可迭代范围
下面的代码中怎么同时定义x和y的范围?>>> list(map(lambda x, y: x + y, range(100)))
Traceback (most recent call last):
File "<string>", line 1, in <module>
TypeError: <lambda>() missing 1 required positional argument: 'y' list(map(lambda x, y: x + y, range(1, 11), range(11, 21)))
页:
[1]