Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. def men():
  2. print("Check Password Strength")
  3. print("Generate a Password")
  4. print("Exit program")
  5. men_choice=int(input("Enter Choice"))
  6. return men_choice
  7.  
  8. def user_pass ():
  9. passw = ""
  10. while len(passw) < 8 or len(passw) > 24:
  11. passw = input("Enter your password. Must be between 8 and 24 characters.")
  12. return passw
  13.  
  14. def points (passw):
  15. score=0
  16. char_up = False
  17. char_low=False
  18. char_digit = False
  19. char_sym = False
  20. sym = ["!", "%", "$", "^", "*", "&", "(", ")", "-", "_", "=", "+"]
  21. for char in passw:
  22. if char.isupper():
  23. char_up = True
  24. elif char.islower():
  25. char_low = True
  26. elif char.isdigit():
  27. char_digit = True
  28. elif char in sym:
  29. char_sym = True
  30. if char_up and char_low and char_digit and char_sym:
  31. score += 10
  32. if char_up:
  33. score += 5
  34. if char_low:
  35. score += 5
  36. if char_digit:
  37. score += 5
  38. if char_sym:
  39. score += 5
  40. return score
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement