python partial偏函数

python partial偏函数

from functools import partial

def func(a,b,c,d):
    return a + b + c + d

tes = partial(func,1)
print(tes)
res = tes(2,3,4)
print(res)

猜你喜欢

转载自www.cnblogs.com/baohanblog/p/12532638.html