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
cbe80169
Kaydet (Commit)
cbe80169
authored
Tem 27, 2006
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add punctuation mark; add some examples
üst
f60eeb17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
librandom.tex
Doc/lib/librandom.tex
+25
-1
No files found.
Doc/lib/librandom.tex
Dosyayı görüntüle @
cbe80169
...
@@ -236,7 +236,7 @@ these equations can be found in any statistics text.
...
@@ -236,7 +236,7 @@ these equations can be found in any statistics text.
\var
{
beta
}
is the shape parameter.
\var
{
beta
}
is the shape parameter.
\end{funcdesc}
\end{funcdesc}
Alternative Generators
Alternative Generators
:
\begin{classdesc}
{
WichmannHill
}{
\optional
{
seed
}}
\begin{classdesc}
{
WichmannHill
}{
\optional
{
seed
}}
Class that implements the Wichmann-Hill algorithm as the core generator.
Class that implements the Wichmann-Hill algorithm as the core generator.
...
@@ -267,6 +267,30 @@ called.
...
@@ -267,6 +267,30 @@ called.
\versionadded
{
2.4
}
\versionadded
{
2.4
}
\end{classdesc}
\end{classdesc}
Examples of basic usage:
\begin{verbatim}
>>> random.random() # Random float x, 0.0 <= x < 1.0
0.37444887175646646
>>> random.uniform(1, 10) # Random float x, 1.0 <= x < 10.0
1.1800146073117523
>>> random.randint(1, 10) # Integer from 1 to 10, endpoints included
7
>>> random.randrange(0, 101, 2) # Even integer from 0 to 100
26
>>> random.choice('abcdefghij') # Choose a random element
'c'
>>> items = [1, 2, 3, 4, 5, 6, 7]
>>> random.shuffle(items)
>>> items
[7, 3, 2, 5, 6, 4, 1]
>>> random.sample([1, 2, 3, 4, 5], 3) # Choose 3 elements
[4, 1, 5]
\end{verbatim}
\begin{seealso}
\begin{seealso}
\seetext
{
M. Matsumoto and T. Nishimura, ``Mersenne Twister: A
\seetext
{
M. Matsumoto and T. Nishimura, ``Mersenne Twister: A
623-dimensionally equidistributed uniform pseudorandom
623-dimensionally equidistributed uniform pseudorandom
...
...
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