mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Close issue #16073: fix map() example in list comprehension documentation.
Thanks for the e-mail report to docs@.
This commit is contained in:
parent
7a1901f861
commit
fd448daf77
1 changed files with 1 additions and 1 deletions
|
@ -181,7 +181,7 @@ We can obtain the same result with::
|
|||
|
||||
squares = [x**2 for x in range(10)]
|
||||
|
||||
This is also equivalent to ``squares = map(lambda x: x**2, range(10))``,
|
||||
This is also equivalent to ``squares = list(map(lambda x: x**2, range(10)))``,
|
||||
but it's more concise and readable.
|
||||
|
||||
A list comprehension consists of brackets containing an expression followed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue