Secrets Modules In Python:
The Secret Module is used for generating random numbers for Managing Important Data such as Password, Account Authentication, Security Tokens and Related Secrets,that are Cryptographically strong.
This Module is responsible for providing Access to the most Secure Source of randomness.This Module is present in Python 3.6 and above.

Examples:-

import secrets
import string
alphabet = string.ascii_letters + string.digits
password = " ".join(secrets.choice(alphabet) for i in range(10))
print(password)

Output:- h i H i J v 9 6 r u
** Note:- This function returnsa randomly-chosen element from a non-empty sequence to manage a basic level of security. **
--------------------------------------------------------------------------------------------------

import secrets
passwd = secrets.randbelow(20)
print(passwd)

Output:- 10
** Note:- This Function returns a random integer in range [0,n] **
--------------------------------------------------------------------------------------------------

import secrets
passwd = secrets.randbits(7)
print(passwd)

Output:-119
** Note:- This Function returns an int with k random bits **