diff --git a/README.md b/README.md index aa2074a..6588bbb 100644 --- a/README.md +++ b/README.md @@ -489,14 +489,19 @@ creature = Creature() Closure ------- ```python -def multiply_closure(x): - def wrapped(y): - return x * y - return wrapped +def multiply_closure(a): + def wrapped(b): + return a * b + return wrapped +``` -multiply_by_3 = multiply_closure(3) +```python +>>> multiply_by_3 = multiply_closure(3) +>>> multiply_by_3(10) +30 ``` + #### Or: ```python from functools import partial