mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
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]`.
This commit is contained in:
parent
fd0ba70f94
commit
9dca295c05
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user