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
87e611e4
Kaydet (Commit)
87e611e4
authored
Ock 06, 1999
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replace the docs for reduce with an adaptation of its docstring, which
was actually clearer!
üst
74429eac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
libfuncs.tex
Doc/lib/libfuncs.tex
+9
-8
No files found.
Doc/lib/libfuncs.tex
Dosyayı görüntüle @
87e611e4
...
...
@@ -501,14 +501,15 @@ If the \module{readline} module was loaded, then
line editing and history features.
\end{funcdesc}
\begin{funcdesc}
{
reduce
}{
function, list
\optional
{
, initializer
}}
Apply the binary
\var
{
function
}
to the items of
\var
{
list
}
so as to
reduce the list to a single value. E.g.,
\code
{
reduce(lambda x, y: x*y,
\var
{
list
}
, 1)
}
returns the product of
the elements of
\var
{
list
}
. The optional
\var
{
initializer
}
can be
thought of as being prepended to
\var
{
list
}
so as to allow reduction
of an empty
\var
{
list
}
. The
\var
{
list
}
arguments may be any kind of
sequence.
\begin{funcdesc}
{
reduce
}{
function, sequence
\optional
{
, initializer
}}
Apply
\var
{
function
}
of two arguments cumulatively to the items of
\var
{
sequence
}
, from left to right, so as to reduce the sequence to
a single value. For example,
\code
{
reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])
}
calculates
\code
{
((((1+2)+3)+4)+5)
}
.
If the optional
\var
{
initializer
}
is present, it is placed before the
items of the sequence in the calculation, and serves as a default when
the sequence is empty.
\end{funcdesc}
\begin{funcdesc}
{
reload
}{
module
}
...
...
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