Skip to content

Instantly share code, notes, and snippets.

@yyolk
Created February 12, 2019 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyolk/45b558c5109d8d6115951e74f2ffb2f0 to your computer and use it in GitHub Desktop.
Save yyolk/45b558c5109d8d6115951e74f2ffb2f0 to your computer and use it in GitHub Desktop.
generates a random psw of 8-16 of length
import string
MIN_LEN, MAX_LEN = 8, 16
from random import randint, choice
characters = string.ascii_letters + string.punctuation + string.digits
password = lambda : "".join(choice(characters) for x in range(randint(MIN_LEN, MAX_LEN)))
print(password())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment