Trusted answers to developer questions

abhilash

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

The ** lognormvariate()** method is used to get floating values chosen from a Lognormal distribution with the given mean and standard deviation.

The **Gaussian distribution**, also known as the *Normal distribution*, is a symmetric probability distribution centered on the mean, indicating that data near the mean occur more frequently than data far from it. The distribution of the logarithmic values of the normal distribution is known as a **lognormal distribution**.

```
random.lognormvariate(mu, sigma)
```

: The mean value.`mu`

: The standard deviation value. This value must be greater than zero.`sigma`

This method returns a floating point value.

import random#mean valuemu = 5#standard deviationsigma = 2.1val = random.lognormvariate(mu, sigma=sigma)print("random.lognormvariate(%s, %s) = %s" % (mu, sigma, val))

- Line 1: We import
`random`

module. - Line 4: We define the mean value,
`mu`

. - Line 7: We define the standard deviation value,
`sigma`

. - Line 8: We store the value returned by the
`lognormvariate()`

method passing`mu`

and`sigma`

as parameters in the variable`val`

. - Line 10: We print
`val`

on to console.

RELATED TAGS

python

communitycreator

random

lognormvariate

CONTRIBUTOR

abhilash

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses