From the course: Python Standard Library Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with random numbers

Working with random numbers - Python Tutorial

From the course: Python Standard Library Essential Training

Start my 1-month free trial

Working with random numbers

- [Instructor] In this chapter, we're going to examine the Python's Standard Library Functions for working with numerical data. And we're going to start off with random number generation. Before we get started, it's important to understand the difference between types of random numbers and how they're used for different scenarios. In the real physical world you can generate random data pretty easily. So for example, you can just roll some dice to generate numbers. Computers don't work that way. They typically use what is called a pseudo-random number generator, or a PRNG. These generators work by using a random value as a seed value, usually based on the system time or some other random value, and then they use that number to derive a random value. So these types of generators are usually used for statistical modeling, or games, or other nonsensitive purposes. They're not considered suitable for sensitive-use cases like ciphers or passwords. For that purpose, we have what are called…

Contents