The randint() function

Attention: Our videos have subtitles in all partner languages. You can switch on subtitles in the youtube player by clicking the gear wheel and selecting your preferred language.

Python has a lot of packages called “modules” which extend the standard functionality. In this section, we show you how to use the random module and generate random numbers. We explain why this is such a useful functionality. You will control the power of randomness. Videogames and simulations use random values all the time, but also advanced statistical analysis and cryptographic applications. Your simple games and school projects will greatly benefit from the creation of random values in your code.