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

Skip to content

Commit 0a90a82

Browse files
committed
zip() returns an iterator, make a list() of it; thanks to Martin from docs@
1 parent fbd4f80 commit 0a90a82

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
@@ -292,7 +292,7 @@ which, in turn, is the same as::
292292
In the real world, you should prefer built-in functions to complex flow statements.
293293
The :func:`zip` function would do a great job for this use case::
294294

295-
>>> zip(*matrix)
295+
>>> list(zip(*matrix))
296296
[(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]
297297

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

0 commit comments

Comments
 (0)