Skip to content

Commit 8496d65

Browse files
committed
Random
1 parent 49f82b4 commit 8496d65

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,19 @@ creature = Creature()
489489
Closure
490490
-------
491491
```python
492-
def multiply_closure(x):
493-
def wrapped(y):
494-
return x * y
495-
return wrapped
492+
def multiply_closure(a):
493+
def wrapped(b):
494+
return a * b
495+
return wrapped
496+
```
496497

497-
multiply_by_3 = multiply_closure(3)
498+
```python
499+
>>> multiply_by_3 = multiply_closure(3)
500+
>>> multiply_by_3(10)
501+
30
498502
```
499503

504+
500505
#### Or:
501506
```python
502507
from functools import partial

0 commit comments

Comments
 (0)