pip install funcy
python
from funcy import *
python
def add_two(x):
return x + 2
def multiply_three(x):
return x * 3
composed_func = compose(add_two, multiply_three)
python
def add(x, y):
return x + y
def multiply(x, y):
return x * y
def apply_operation(operation, x, y):
return operation(x, y)
multiply_func = partial(apply_operation, multiply)
python
numbers = [1, 2, 3, 4, 5]