mirror of
https://github.com/python/cpython.git
synced 2025-10-23 07:02:24 +00:00
#3522: zip() returns an iterator.
This commit is contained in:
parent
676cce3b4b
commit
409c9d7184
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ A more verbose version of this snippet shows the flow explicitly::
|
||||||
In real world, you should prefer builtin functions to complex flow statements.
|
In real world, you should prefer builtin functions to complex flow statements.
|
||||||
The :func:`zip` function would do a great job for this use case::
|
The :func:`zip` function would do a great job for this use case::
|
||||||
|
|
||||||
>>> zip(*mat)
|
>>> list(zip(*mat))
|
||||||
[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
|
[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
|
||||||
|
|
||||||
See :ref:`tut-unpacking-arguments` for details on the asterisk in this line.
|
See :ref:`tut-unpacking-arguments` for details on the asterisk in this line.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue