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 ** normalvariate** method in Python is used to get a floating-point value that is chosen from a Gaussian/normal distribution with the given mean and standard deviation.

The ** Gaussian distribution**, also known as

The following image shows us what a bell curve looks like when plotted on a graph:

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

: This is the mean value.`mu`

: This is the standard deviation value.`sigma`

This method returns a floating-point value.

import randommu = 5sigma = 4.3val = random.normalvariate(mu, sigma=sigma)print("random.normalvariate(%s, %s) = %s" % (mu, sigma, val))

- Line 1: We import the
`random`

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

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

. - Line 5: We store the value that is returned by the
`normalvariate()`

method, as we pass`mu`

and`sigma`

as parameters in the variable`val`

. - Line 7: We print the variable
`val`

to console.

RELATED TAGS

python

communitycreator

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