pip install funcy python from funcy import map numbers = [1, 2, 3, 4, 5] squared_numbers = map(lambda x: x ** 2, numbers) python from funcy import compose add_double = compose(lambda x: x * 2, lambda x: x + 5) result = add_double(10) python from funcy import filter numbers = [1, 2, 3, 4, 5] even_numbers = filter(lambda x: x % 2 == 0, numbers) python from funcy import reduce numbers = [1, 2, 3, 4, 5] sum = reduce(lambda x, y: x + y, numbers)


上一篇:
下一篇:
切换中文