Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Creates a strong random password from 8-16 characters
import string
from random import randint, choice
letter = string.ascii_letters
nums = string.digits
specialChar = string.punctuation
chars = letter + nums + specialChar
min_length = 8
max_length = 16
password = "".join(choice(chars) for x in range(randint(min_length, max_length)))
print("Your random password is " + password)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.