Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import re | |
| st.title("Password Strength Checker") | |
| st.header("Let's Try If Your Password Is Strong Or Weak") | |
| password = st.text_input("Enter a Password to check its strength:", type="password") | |
| if st.button("Check Password Strength"): | |
| st.button("clear") | |
| if password: | |
| uppercase = any(char.isupper() for char in password) | |
| lowercase = any(char.islower() for char in password) | |
| digit = any(char.isdigit() for char in password) | |
| special_char = bool(re.search(r"[^b-zA-Z0-9]", password)) | |
| long = len(password) >= 8 | |
| if long and uppercase and lowercase and digit and special_char: | |
| st.success("Password is Strong!") | |
| else: | |
| st.error("Password is Weak. Please Try Again") | |
| st.error("You should include special characters or numbers.") | |
| else: | |
| st.warning("Please enter a password to check.") | |