Skip to content

Instantly share code, notes, and snippets.

@digital-shokunin
Last active July 4, 2024 04:44
Show Gist options
  • Save digital-shokunin/ad1d2eef232f162da20bfb6a433469cd to your computer and use it in GitHub Desktop.
Save digital-shokunin/ad1d2eef232f162da20bfb6a433469cd to your computer and use it in GitHub Desktop.
Password Generator
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