We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 66a4cf1 + db979f1 commit 368c1f0Copy full SHA for 368c1f0
map_&_filter.rst
@@ -33,7 +33,7 @@ Here you go:
33
.. code:: python
34
35
items = [1, 2, 3, 4, 5]
36
- squared = map(lambda x: x**2, items)
+ squared = list(map(lambda x: x**2, items))
37
38
Most of the times we use lambdas with ``map`` so I did the same. Instead
39
of a list of inputs we can even have a list of functions!
@@ -47,7 +47,7 @@ of a list of inputs we can even have a list of functions!
47
48
funcs = [multiply, add]
49
for i in range(5):
50
- value = map(lambda x: x(i), funcs)
+ value = list(map(lambda x: x(i), funcs))
51
print(value)
52
53
# Output:
0 commit comments