summaryrefslogtreecommitdiffhomepage
path: root/python3.html.markdown
diff options
context:
space:
mode:
authorAlfredo Canziani <alfredo.canziani@gmail.com>2016-03-30 11:17:12 -0400
committerAlfredo Canziani <alfredo.canziani@gmail.com>2016-03-30 11:17:12 -0400
commit9dca295c055502d333e2ab1f4a1f9ae6f39f4b9e (patch)
tree28eff4e731cfb670031d97f1a00c0d28a7c91901 /python3.html.markdown
parentfd0ba70f94ac7016bbd38d70fc8f7805a42434c8 (diff)
Update python3.html.markdown
`map` requires `list` in order to convert the mapping to its list. E.g. `<map at 0x11057ce48>` to `[11, 12, 13]`.
Diffstat (limited to 'python3.html.markdown')
-rw-r--r--python3.html.markdown4
1 files changed, 2 insertions, 2 deletions
diff --git a/python3.html.markdown b/python3.html.markdown
index ea29fdba..7864ae3f 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -589,8 +589,8 @@ add_10(3) # => 13
# TODO - Fix for iterables
# There are built-in higher order functions
-map(add_10, [1, 2, 3]) # => [11, 12, 13]
-map(max, [1, 2, 3], [4, 2, 1]) # => [4, 2, 3]
+list(map(add_10, [1, 2, 3])) # => [11, 12, 13]
+list(map(max, [1, 2, 3], [4, 2, 1])) # => [4, 2, 3]
filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7]