Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd448da

Browse files
committed
Close issue #16073: fix map() example in list comprehension documentation.
Thanks for the e-mail report to docs@.
1 parent 7a1901f commit fd448da

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/tutorial/datastructures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ We can obtain the same result with::
181181

182182
squares = [x**2 for x in range(10)]
183183

184-
This is also equivalent to ``squares = map(lambda x: x**2, range(10))``,
184+
This is also equivalent to ``squares = list(map(lambda x: x**2, range(10)))``,
185185
but it's more concise and readable.
186186

187187
A list comprehension consists of brackets containing an expression followed

0 commit comments

Comments
 (0)