mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
Another typo (in the list comprehension example).
This commit is contained in:
parent
4d46d38292
commit
56db095018
@ -122,7 +122,7 @@ from another list (or lists). The simplest form is:
|
||||
|
||||
[<expression> for <variable> in <sequence>]
|
||||
|
||||
For example, [x**2 for i in range(4)] yields the list [0, 1, 4, 9].
|
||||
For example, [i**2 for i in range(4)] yields the list [0, 1, 4, 9].
|
||||
This is more efficient than map() with a lambda.
|
||||
|
||||
You can also add a condition:
|
||||
|
Loading…
Reference in New Issue
Block a user