Open this example in the interactive library
Source code
from functools import partial
base_two = partial(int, base=2)
print(base_two('1011'))Sample output
11

Bind arguments with partial. A self-contained example using the Python standard library.
Open this example in the interactive library
from functools import partial
base_two = partial(int, base=2)
print(base_two('1011'))11