Created
May 6, 2014 15:07
-
-
Save jcaxmacher/6e06d98a64ab91acef8f 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 random | |
def random_password(): | |
alpha_lower = random.sample('abcdefghijklmnopqrstuvwxyz', 5) | |
alpha_upper = random.sample('ABCDEFGHIJKLMNOPQRSTUVWXYZ', 10) | |
num = random.sample('0123456789', 4) | |
special = random.sample('!@#$%^&*', 4) | |
full = alpha_upper + alpha_lower + num + special | |
random.shuffle(full) | |
return ''.join(full) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment