Skip to content

Instantly share code, notes, and snippets.

@kunpengku
Created August 22, 2017 06:40
Show Gist options
  • Save kunpengku/b0301c02fed9371d48379ec8ce0b0e9d to your computer and use it in GitHub Desktop.
Save kunpengku/b0301c02fed9371d48379ec8ce0b0e9d to your computer and use it in GitHub Desktop.
import functools
def add(a, b):
return a + b
add(4, 2)
6
plus3 = functools.partial(add, 3)
plus5 = functools.partial(add, 5)
plus3(4)
7
plus3(7)
10
plus5(10)
15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment