|
|
发表于 2016-8-27 19:29:37
|
显示全部楼层
本楼为最佳答案
- >>> import random as rnd
- >>> help(rnd.uniform)
- Help on method uniform in module random:
- uniform(a, b) method of random.Random instance
- Get a random number in the range [a, b) or [a, b] depending on rounding.
- >>> help(rnd.expovariate)
- Help on method expovariate in module random:
- expovariate(lambd) method of random.Random instance
- Exponential distribution.
-
- lambd is 1.0 divided by the desired mean. It should be
- nonzero. (The parameter would be called "lambda", but that is
- a reserved word in Python.) Returned values range from 0 to
- positive infinity if lambd is positive, and from negative
- infinity to 0 if lambd is negative.
- >>>
复制代码 |
|