Skip to content

Commit 915827d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 54eacb1 commit 915827d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

strong_password_detection.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
def strong_password_detection(password):
2-
3-
AllowedSymbols = ['#', '@', '$', '_', '*', '-']
2+
AllowedSymbols = ["#", "@", "$", "_", "*", "-"]
43
flag = 1
54
# length of the entered password should be at least 6
65
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")
87
flag = 0
98
# length of the entered password should be not be greater than 15
109
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")
1211
flag = 0
1312
# The entered password should have at least one numeral
1413
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")
1615
flag = 0
1716
# Password should have at least one lowercase letter
1817
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")
2019
flag = 0
2120
# The entered password should have at least one uppercase letter
2221
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")
2423
flag = 0
2524
# The entered password should have at least one of the symbols $@#_*
2625
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 $@#_*")
2827
flag = 0
2928
if flag:
3029
return flag
@@ -33,11 +32,11 @@ def strong_password_detection(password):
3332
def main():
3433
password = input()
3534

36-
if (strong_password_detection(password)):
35+
if strong_password_detection(password):
3736
print("The entered password is strong !!")
3837
else:
3938
print("The entered password is weak !!")
4039

4140

42-
if __name__ == '__main__':
41+
if __name__ == "__main__":
4342
main()

0 commit comments

Comments
 (0)