Last active
July 4, 2024 04:44
-
-
Save digital-shokunin/ad1d2eef232f162da20bfb6a433469cd to your computer and use it in GitHub Desktop.
Password Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import secrets | |
def generate_password(length=20): | |
alphabet = string.ascii_letters + string.digits + string.punctuation | |
password = ''.join(secrets.choice(alphabet) for _ in range(length)) | |
return password | |
print(generate_password()) | |
print(generate_password(25)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment