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

Skip to content

Commit 409c9d7

Browse files
committed
#3522: zip() returns an iterator.
1 parent 676cce3 commit 409c9d7

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
@@ -257,7 +257,7 @@ A more verbose version of this snippet shows the flow explicitly::
257257
In real world, you should prefer builtin functions to complex flow statements.
258258
The :func:`zip` function would do a great job for this use case::
259259

260-
>>> zip(*mat)
260+
>>> list(zip(*mat))
261261
[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
262262

263263
See :ref:`tut-unpacking-arguments` for details on the asterisk in this line.

0 commit comments

Comments
 (0)