Posts

Showing posts from September, 2022

Python Random Module

  Python Random Module Python contains many files that can be imported into a python code and used whenever we want. One of those modules is the random module. It is a good practice to know about the modules in python . This module is used to generate random numbers in python. Whenever we write a code and want to generate a random number in our code, then we use the random module in python. Using the Python random module The random module is an in-built module in python. It generates pseudo-random numbers that are not exactly random but seem that way.   This can be used in many ways as generating random values, printing random values, selecting a random index in an array, etc. Before using this module, we have to import it first. We can import the random module using the import statement. import random As we already know from the above paragraph, that random module gives pseudo-random numbers, which means that the number is not random. They depend on the seeding value. Sa