Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def men():
- print("Check Password Strength")
- print("Generate a Password")
- print("Exit program")
- men_choice=int(input("Enter Choice"))
- return men_choice
- def user_pass ():
- passw = ""
- while len(passw) < 8 or len(passw) > 24:
- passw = input("Enter your password. Must be between 8 and 24 characters.")
- return passw
- def points (passw):
- score=0
- char_up = False
- char_low=False
- char_digit = False
- char_sym = False
- sym = ["!", "%", "$", "^", "*", "&", "(", ")", "-", "_", "=", "+"]
- for char in passw:
- if char.isupper():
- char_up = True
- elif char.islower():
- char_low = True
- elif char.isdigit():
- char_digit = True
- elif char in sym:
- char_sym = True
- if char_up and char_low and char_digit and char_sym:
- score += 10
- if char_up:
- score += 5
- if char_low:
- score += 5
- if char_digit:
- score += 5
- if char_sym:
- score += 5
- return score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement