diff --git a/Password-Strength-Checker/Password-Strength-Checker/README.md b/Password-Strength-Checker/Password-Strength-Checker/README.md new file mode 100644 index 0000000..8b2a891 --- /dev/null +++ b/Password-Strength-Checker/Password-Strength-Checker/README.md @@ -0,0 +1,23 @@ +# Password Strength Checker + +A Python program that evaluates password strength based on: + +- Minimum length of 8 characters +- Uppercase letters +- Lowercase letters +- Numbers +- Special characters + +## Example + +Input: +Password@123 + +Output: +Strong Password + +## How to Run + +```bash +python password_strength_checker.py +``` diff --git a/Password-Strength-Checker/password_strength_checker.py b/Password-Strength-Checker/password_strength_checker.py new file mode 100644 index 0000000..b1f7296 --- /dev/null +++ b/Password-Strength-Checker/password_strength_checker.py @@ -0,0 +1,29 @@ +def check_password_strength(password): + strength = 0 + + if len(password) >= 8: + strength += 1 + + if any(char.isupper() for char in password): + strength += 1 + + if any(char.islower() for char in password): + strength += 1 + + if any(char.isdigit() for char in password): + strength += 1 + + if any(char in "!@#$%^&*()_+-=[]{}|;:,.<>?/`~" for char in password): + strength += 1 + + if strength <= 2: + return "Weak Password" + elif strength <= 4: + return "Moderate Password" + else: + return "Strong Password" + + +password = input("Enter Password: ") +result = check_password_strength(password) +print("Password Strength:", result)