Python‎ > ‎random‎ > ‎

random.paretovariate()

http://www.adilwaseem.com/

Introduction
The paretovariate(alpha) method of random.Random instance Pareto distribution.

Syntax
random.paretovariate(alpha)-> random pareto distribution

Parameters
alpha=shape parameter.

Example
import random
x=random.paretovariate(33)
print(x)

>>> 
1.0032808734508185
>>>

if statement  within for loop between random methods
The method returns with the for loop after finding the subtraction of random values.
import operator
import random
a=random.triangular(7,14)
b=random.uniform(2,5)
x=int(round(operator.sub(a,b)))
for i in range(x, 30):
    print(i)
    if i.__ge__(30):
        b=int(round(random.paretovariate(3)))
        print(i)

>>> 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
>>>

Comments