Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from random import choice
import string
alphabet = string.ascii_letters
uppercaseAlphabet = alphabet.upper()
symbols = string.punctuation
numbers = string.digits
characterSets = [alphabet, symbols, numbers, uppercaseAlphabet]
LENGTH = 10
def gen_password():
result = ""
for _ in range(LENGTH):
characterSet = choice(characterSets)
character = choice(characterSet)
result += character
return result
def main():
print(gen_password())
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment