1
1
def strong_password_detection (password ):
2
-
3
- AllowedSymbols = ['#' , '@' , '$' , '_' , '*' , '-' ]
2
+ AllowedSymbols = ["#" , "@" , "$" , "_" , "*" , "-" ]
4
3
flag = 1
5
4
# length of the entered password should be at least 6
6
5
if len (password ) < 6 :
7
- print (' length of the entered password should be at least 6' )
6
+ print (" length of the entered password should be at least 6" )
8
7
flag = 0
9
8
# length of the entered password should be not be greater than 15
10
9
if len (password ) > 15 :
11
- print (' length of the entered password should be not be greater than 15' )
10
+ print (" length of the entered password should be not be greater than 15" )
12
11
flag = 0
13
12
# The entered password should have at least one numeral
14
13
if not any (char .isdigit () for char in password ):
15
- print (' The entered password should have at least one numeral' )
14
+ print (" The entered password should have at least one numeral" )
16
15
flag = 0
17
16
# Password should have at least one lowercase letter
18
17
if not any (char .islower () for char in password ):
19
- print (' the entered password should have at least one lowercase letter' )
18
+ print (" the entered password should have at least one lowercase letter" )
20
19
flag = 0
21
20
# The entered password should have at least one uppercase letter
22
21
if not any (char .isupper () for char in password ):
23
- print (' The entered password should have at least one uppercase letter' )
22
+ print (" The entered password should have at least one uppercase letter" )
24
23
flag = 0
25
24
# The entered password should have at least one of the symbols $@#_*
26
25
if not any (char in AllowedSymbols for char in password ):
27
- print (' The entered password should have at least one of the symbols $@#_*' )
26
+ print (" The entered password should have at least one of the symbols $@#_*" )
28
27
flag = 0
29
28
if flag :
30
29
return flag
@@ -33,11 +32,11 @@ def strong_password_detection(password):
33
32
def main ():
34
33
password = input ()
35
34
36
- if ( strong_password_detection (password ) ):
35
+ if strong_password_detection (password ):
37
36
print ("The entered password is strong !!" )
38
37
else :
39
38
print ("The entered password is weak !!" )
40
39
41
40
42
- if __name__ == ' __main__' :
41
+ if __name__ == " __main__" :
43
42
main ()
0 commit comments