From aabd2c162564f2aff33888cd929bf46b1571d2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 25 Dec 2018 20:32:00 +0100 Subject: [PATCH] Closure --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2c97757..f4b115b 100644 --- a/README.md +++ b/README.md @@ -489,19 +489,18 @@ creature = Creature() Closure ------- ```python -def multiply_closure(a): +def get_multiplier(a): def out(b): return a * b return out ``` ```python ->>> multiply_by_3 = multiply_closure(3) +>>> multiply_by_3 = get_multiplier(3) >>> multiply_by_3(10) 30 ``` - #### Or: ```python from functools import partial