How the random function is built (in Python for example)?


Hi :slight_smile:

Here’s the code academy introduction of data science which makes me wonder about how to code ramdomness

it seems an pretty interesting question to my mind.

I’m newbie and i do not know a lot about maths, so if you want to respond with an equation, please explain it with words too.

Thanks for enlightning my mind !


I find this interesting article :
The article explains that computers can generate true random numbers or pseudorandom numbers.

In the exercise above, when we call random.choice(months) in Python, does the computer generates true random numbers or pseudorandom numbers ?


The random module classes generate pseudo-random numbers.


The pseudo-random generators of this module should not be used for security purposes. Use os.urandom() or SystemRandom if you require a cryptographically secure pseudo-random number generator.