Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
dd1150e3
Kaydet (Commit)
dd1150e3
authored
Mar 13, 2008
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sync-up with doc improvements in Py2.6
üst
736c0ab4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
functions.rst
Doc/library/functions.rst
+17
-7
itertools.rst
Doc/library/itertools.rst
+0
-0
No files found.
Doc/library/functions.rst
Dosyayı görüntüle @
dd1150e3
...
...
@@ -1104,20 +1104,30 @@ available. They are listed here in alphabetical order.
the effects on the corresponding symbol table are undefined. [#]_
.. function:: zip(
[iterable, ...]
)
.. function:: zip(
*iterables
)
This function returns an iterator of tuples, where the *i*-th tuple contains
Make an iterator that aggregates elements from each of the iterables.
Returns an iterator of tuples, where the *i*-th tuple contains
the *i*-th element from each of the argument sequences or iterables. The
iterator stops when the shortest argument sequence is exhausted. When there
are multiple arguments which are all of the same length, :func:`zip` is
similar to :func:`map` with an initial argument of ``None``. With a single
sequence argument, it returns an iterator of 1-tuples. With no arguments, it
returns an empty iterator.
iterator stops when the shortest input iterable is exhausted. With a single
iterable argument, it returns an iterator of 1-tuples. With no arguments,
it returns an empty iterator. Equivalent to::
def zip(*iterables):
# zip('
ABCD
', '
xy
') --> Ax By
iterables = map(iter, iterables)
while iterables:
result = [it.next() for it in iterables]
yield tuple(result)
The left-to-right evaluation order of the iterables is guaranteed. This
makes possible an idiom for clustering a data series into n-length groups
using ``zip(*[iter(s)]*n)``.
:func:`zip` should only be used with unequal length inputs when you don'
t
care
about
trailing
,
unmatched
values
from
the
longer
iterables
.
If
those
values
are
important
,
use
:
func
:`
itertools
.
zip_longest
`
instead
.
..
rubric
::
Footnotes
...
...
Doc/library/itertools.rst
Dosyayı görüntüle @
dd1150e3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment