-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1628 from SaharshDaNerd/patch-1
created a new password checker file
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Program's_Contributed_By_Contributors/Python_Programs/password_checker.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
l, u, p, d = 0, 0, 0, 0 | ||
s = "we_lov3_h@ct0ber" | ||
if (len(s) >= 8): | ||
for i in s: | ||
|
||
# counting lowercase alphabets in the given password | ||
if (i.islower()): | ||
l+=1 | ||
|
||
# counting uppercase alphabets in the given password | ||
if (i.isupper()): | ||
u+=1 | ||
|
||
# counting digits in the given password | ||
if (i.isdigit()): | ||
d+=1 | ||
|
||
# counting the mentioned special characters | ||
if(i=='@'or i=='$' or i=='_'): | ||
p+=1 | ||
if (l>=1 and u>=1 and p>=1 and d>=1 and l+p+u+d==len(s)): | ||
print("Valid Password!") | ||
else: | ||
print("Invalid Password") |