diff options
author | Adam Bard <github@adambard.com> | 2016-03-30 13:03:40 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2016-03-30 13:03:40 -0700 |
commit | a7bbee6aa02be67f1844bce6817892d91b9422ab (patch) | |
tree | e3e33b3a258d1de1ba4eea7e86da93383b3827d2 | |
parent | fd0ba70f94ac7016bbd38d70fc8f7805a42434c8 (diff) | |
parent | 6248cd1f84401548b80b48c9f1c4b55502c20095 (diff) |
Merge pull request #2220 from Atcold/patch-1
Update python3.html.markdown
-rw-r--r-- | python3.html.markdown | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python3.html.markdown b/python3.html.markdown index ea29fdba..c2454076 100644 --- a/python3.html.markdown +++ b/python3.html.markdown @@ -589,10 +589,10 @@ 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] +list(filter(lambda x: x > 5, [3, 4, 5, 6, 7])) # => [6, 7] # We can use list comprehensions for nice maps and filters # List comprehension stores the output as a list which can itself be a nested list |