Created
February 28, 2021 16:03
-
-
Save cristinelpopescu/22c919d3e875462492ba95b6ca525fcb to your computer and use it in GitHub Desktop.
Advanced password generator
This file contains hidden or 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
import string | |
import random | |
def pw_gen(size = 8, chars=string.ascii_letters + string.digits + string.punctuation): | |
return ''.join(random.choice(chars) for _ in range(size)) | |
print(pw_gen(int(input('How many characters in your password? (enter an integer value) ')))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment