Created
September 2, 2020 05:22
-
-
Save Levi-Lesches/bf70e4a21d35a377674d5b9a8993df1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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