K0RB1 commited on
Commit
53a8f96
·
1 Parent(s): 691411c
Files changed (2) hide show
  1. app.py +12 -7
  2. requirements.txt +1 -0
app.py CHANGED
@@ -3,24 +3,29 @@ import re
3
 
4
 
5
  st.title("Password Strength Checker")
 
6
 
7
 
8
  password = st.text_input("Enter a Password to check its strength:", type="password")
9
 
10
 
11
  if st.button("Check Password Strength"):
 
12
  if password:
13
 
14
- has_uppercase = any(char.isupper() for char in password)
15
- has_lowercase = any(char.islower() for char in password)
16
- has_digit = any(char.isdigit() for char in password)
17
- has_special_char = bool(re.search(r"[^a-zA-Z0-9]", password))
18
- is_long_enough = len(password) >= 8
19
 
20
 
21
- if is_long_enough and has_uppercase and has_lowercase and has_digit and has_special_char:
22
  st.success("Password is Strong!")
23
  else:
24
- st.error("Password is Weak!!!")
 
25
  else:
26
  st.warning("Please enter a password to check.")
 
 
 
3
 
4
 
5
  st.title("Password Strength Checker")
6
+ st.header("Let's Try If Your Password Is Strong Or Weak")
7
 
8
 
9
  password = st.text_input("Enter a Password to check its strength:", type="password")
10
 
11
 
12
  if st.button("Check Password Strength"):
13
+ st.button("clear")
14
  if password:
15
 
16
+ uppercase = any(char.isupper() for char in password)
17
+ lowercase = any(char.islower() for char in password)
18
+ digit = any(char.isdigit() for char in password)
19
+ special_char = bool(re.search(r"[^b-zA-Z0-9]", password))
20
+ long = len(password) >= 8
21
 
22
 
23
+ if long and uppercase and lowercase and digit and special_char:
24
  st.success("Password is Strong!")
25
  else:
26
+ st.error("Password is Weak. Please Try Again")
27
+ st.error("You should include special characters or numbers.")
28
  else:
29
  st.warning("Please enter a password to check.")
30
+
31
+
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit