mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
#4562: fix zip() examples.
This commit is contained in:
parent
518d8da05c
commit
17fe364b44
1 changed files with 2 additions and 2 deletions
|
@ -1161,9 +1161,9 @@ are always available. They are listed here in alphabetical order.
|
|||
>>> x = [1, 2, 3]
|
||||
>>> y = [4, 5, 6]
|
||||
>>> zipped = zip(x, y)
|
||||
>>> zipped
|
||||
>>> list(zipped)
|
||||
[(1, 4), (2, 5), (3, 6)]
|
||||
>>> x2, y2 = zip(*zipped)
|
||||
>>> x2, y2 = zip(*zip(x, y))
|
||||
>>> x == x2, y == y2
|
||||
True
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue