File size: 933 Bytes
691411c
 
 
 
 
53a8f96
691411c
 
 
 
 
 
53a8f96
691411c
 
53a8f96
 
 
 
 
691411c
 
53a8f96
691411c
 
53a8f96
 
691411c
 
53a8f96
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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.")