A module is a file containing Python definitions and statement | cσ∂ιηg cυℓтs
A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. Within a module, the module’s name (as a string) is available as the value of the global variable name
You can get a very detailed info from here
So today we are discussion about "random" module in python
This module implements pseudo-random number generators for various distributions.
For integers, there is uniform selection from a range. For sequences, there is uniform selection of a random element, a function to generate a random permutation of a list in-place, and a function for random sampling without replacement.
On the real line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available.
Almost all module functions depend on the basic function random(), which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit precision floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes.
for details info head over to this site
The random module also provides the SystemRandom class which uses the system function os.urandom() to generate random numbers from sources provided by the operating system.
So, lets see what you can develop using random module
You can build own password generator
Own otp generator own toss system
Even own dice system and make a game like ludo
FOR A DETAILED explanation must check out this site https://www.w3schools.com/python/module_random.asp
PASSWORD GENERATOR
import random
print("Your Generated Password is")
x = "abcdefghijklmnopqrstuvwxyz@#$-/*-+"
password = "".join(random.sample(x, 10))
print(password)
Its a very simple password generator in python
You can use if else statements to make it more attractive
HAPPY CODING,
regards- @nileshbansal24