Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
40ebe948
Commit
40ebe948
authored
Jan 30, 2019
by
Raymond Hettinger
Committed by
GitHub
Jan 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document differences between random.choices() and random.choice(). (GH-11703)
parent
cf991e65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Doc/library/random.rst
Doc/library/random.rst
+7
-0
No files found.
Doc/library/random.rst
View file @
40ebe948
...
...
@@ -162,6 +162,13 @@ Functions for sequences
with the :class:`float` values returned by :func:`random` (that includes
integers, floats, and fractions but excludes decimals).
For a given seed, the :func:`choices` function with equal weighting
typically produces a different sequence than repeated calls to
:func:`choice`. The algorithm used by :func:`choices` uses floating
point arithmetic for internal consistency and speed. The algorithm used
by :func:`choice` defaults to integer arithmetic with repeated selections
to avoid small biases from round-off error.
.. versionadded:: 3.6
...
...
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