Generates a really strong and secure password. It uses multiple characters and symbols. Remember to score please! It really means a lot to me. Revision 4 includes an input so you can choose how many characters you want your password to have. It is also faster due to a suggestion by Garel Alex. Thanks!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ##Author: ATC
##Please score this on activestate
import string, random
print "How many characters would you like the password to have?"
print "Must be nine or more"
length = input ()
password_len = length
password = []
for group in (string.ascii_letters, string.punctuation, string.digits):
password += random.sample(group, 3)
password += random.sample(
string.ascii_letters + string.punctuation + string.digits,
password_len - len(password))
random.shuffle(password)
password = ''.join(password)
print password
|
Any suggestions?
Better than checking afterwards, meet the requirement from the begining :
sorry instead of:
It is:
Thank you for your code. Try looking at Generating And Checking Passwords In Python