mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Add detail to comment on range of random.random() (gh-111868)
--------- Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
parent
0c42f7304a
commit
2f2a0a3a6c
1 changed files with 1 additions and 1 deletions
|
|
@ -153,7 +153,7 @@ The :mod:`random` module provides tools for making random selections::
|
||||||
'apple'
|
'apple'
|
||||||
>>> random.sample(range(100), 10) # sampling without replacement
|
>>> random.sample(range(100), 10) # sampling without replacement
|
||||||
[30, 83, 16, 4, 8, 81, 41, 50, 18, 33]
|
[30, 83, 16, 4, 8, 81, 41, 50, 18, 33]
|
||||||
>>> random.random() # random float
|
>>> random.random() # random float from the interval [0.0, 1.0)
|
||||||
0.17970987693706186
|
0.17970987693706186
|
||||||
>>> random.randrange(6) # random integer chosen from range(6)
|
>>> random.randrange(6) # random integer chosen from range(6)
|
||||||
4
|
4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue