Created
December 31, 2015 16:35
-
-
Save anonymous/4a752288b785312ca840 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
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?')))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, can i get some explanation for the function above ?