Skip to content

Instantly share code, notes, and snippets.

@Code-Victor
Created February 17, 2023 16:39
Show Gist options
  • Select an option

  • Save Code-Victor/107ff1dffcdffe0d8d9f10b5262cfe1d to your computer and use it in GitHub Desktop.

Select an option

Save Code-Victor/107ff1dffcdffe0d8d9f10b5262cfe1d to your computer and use it in GitHub Desktop.
import random
LOWERCASE_ALPHABETS = "abcdefghijklmnopqrstuvwxyz"
UPPERCASE_ALPHABETS = LOWERCASE_ALPHABETS.upper()
DIGITS = "0123456789"
SPECIAL_CHARACTERS = "!@#$%^&*()_+"
ALL = LOWERCASE_ALPHABETS + UPPERCASE_ALPHABETS + DIGITS + SPECIAL_CHARACTERS
PASSWORD_LENGTH = 12
password = "".join(random.choices(ALL, k=PASSWORD_LENGTH))
print(password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment