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

Skip to content

Commit 17fe364

Browse files
committed
#4562: fix zip() examples.
1 parent 518d8da commit 17fe364

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/functions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,9 +1161,9 @@ are always available. They are listed here in alphabetical order.
11611161
>>> x = [1, 2, 3]
11621162
>>> y = [4, 5, 6]
11631163
>>> zipped = zip(x, y)
1164-
>>> zipped
1164+
>>> list(zipped)
11651165
[(1, 4), (2, 5), (3, 6)]
1166-
>>> x2, y2 = zip(*zipped)
1166+
>>> x2, y2 = zip(*zip(x, y))
11671167
>>> x == x2, y == y2
11681168
True
11691169

0 commit comments

Comments
 (0)