import numpy as np
c = np.random.random()
Then we know c is uniformly distributed over the half-open interval [0,1) and the probability density function (pdf) of c is given by, $$ p(c) = \begin{cases} \frac{1}{1-0}~\text{ for}~ 0 \leq c < 1\\ 0,~\text{otherwise} \end{cases} $$ Now, if we generate d as follows:
scalar = 30
d = scalar * np.random.random()
then what is the pdf of d i.e. p(d)?
d also has a uniform distribution, but now it's on the range $[0,30)$. So $$ p(d) = \begin{cases} \frac{1}{30-0}~\text{ for}~ 0 \leq d < 30\\ 0,~\text{otherwise} \end{cases} $$