functools

1、偏函数

import functools
int("1010",base=2)

#把一个参数固定住,形成新的参数
s=functools.partial(int,base=2)
print(s('1111'))
View Code

 

posted @ 2019-08-08 12:33  pdun  阅读(102)  评论(0编辑  收藏  举报