Advertisement
ellesehc

Password_policy_template (No recursion)

Feb 20th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. def passwordChecker():
  2.         while True:
  3.                 password = raw_input("Input password: ")
  4.                 if len(password) > 7 and len(password) < 33:
  5.                         if any(char.isupper() for char in password) and any(char.islower() for char in password) and any(char.isdigit() for char in password):
  6.                                 print "Strong password!"
  7.                                 break
  8.                         else:
  9.                 print "Weak password!"
  10.         else:
  11.             if len(password) < 8:
  12.                 print "Password should be at least 8 characters long."
  13.             elif len(password) > 32:
  14.                 print "Password should be less than 33 characters long."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement