Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #First
- def passwordChecker():
- password = raw_input("Input password: ")
- if len(password) < 8:
- print "Password is unacceptable. Should be more than 8 characters long."
- passwordChecker()
- elif len(password) > 32:
- print "Password is unacceptable. Should be less than 32 characters long."
- passwordChecker()
- else:
- if any(char.isupper() for char in password) and any(char.islower() for char in password) and any(char.isdigit() for char in password):
- print "Strong password!"
- else:
- print "Weak Password!"
- passwordChecker()
- #Second
- def passwordChecker():
- password = raw_input("Input password: ")
- if len(password) < 8:
- print "Password is unacceptable. Should be more than 8 characters long."
- passwordChecker()
- elif len(password) > 32:
- print "Password is unacceptable. Should be less than 32 characters long."
- passwordChecker()
- else:
- if any(char.isupper() for char in password) and any(char.islower() for char in password) and any(char.isdigit() for char in password):
- print "Strong password!"
- else:
- print "Weak Password!"
- passwordChecker()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement