Skip to content

Commit 3e3e796

Browse files
committed
currying
1 parent cb3b595 commit 3e3e796

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

source/modules/lesson08/currying.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,31 @@ Real-world-example
6464
particular value. Here is that technique, applied to the multiplier
6565
problem:
6666
67-
```
67+
.. code-block:: python
68+
6869
def get_multiplier(n = 3):
6970
def multiplier(x)
7071
return x * n
7172
return multiplier
7273
73-
```
7474
7575
Now, in this case, we still had to define \ *multiplier* inside
7676
of \ *get_multiplier*, which presented no major issues, but
7777
could become more cumbersome in the next scenario. Imagine you have a
7878
Python module called \ *introductions.py*. Inside of that module,
7979
there is a single function called \ *introduce_person()*:
8080
81-
```
81+
.. code-block:: python
8282
8383
# introductions.py
8484
def introduce_person(name, age, job, location):
8585
return "This is %s, a %d-year-old %s living in %s" % (name, age, job, location)
8686
87-
```
8887
8988
The *introduce_person *\ method allows you to create a basic string
9089
to introduce a person. It takes four parameters.
9190
92-
```
91+
.. code-block:: python
9392
9493
>>> from introductions import introduce_person
9594
>>> introduce_person("Elisa", 28, "engineer", "Portland")

0 commit comments

Comments
 (0)