Last active
October 2, 2017 01:49
-
-
Save SpikeXy/97ca4a931ad879117c365c2d71a72234 to your computer and use it in GitHub Desktop.
functools #python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 使用functools.partial创建新的函数 | |
>>> import functools | |
>>> int2 = functools.partial(int, base=2) | |
>>> int2('1000000') | |
64 | |
>>> int2('1010101') | |
85 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment