Skip to content

Instantly share code, notes, and snippets.

@cristinelpopescu
Created February 28, 2021 16:03
Show Gist options
  • Save cristinelpopescu/22c919d3e875462492ba95b6ca525fcb to your computer and use it in GitHub Desktop.
Save cristinelpopescu/22c919d3e875462492ba95b6ca525fcb to your computer and use it in GitHub Desktop.
Advanced password generator
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