Skip to content

Commit

Permalink
Merge pull request #1628 from SaharshDaNerd/patch-1
Browse files Browse the repository at this point in the history
created a new password checker file
  • Loading branch information
fineanmol committed Oct 1, 2022
2 parents cdb8526 + 7e7c3da commit 6307c88
Showing 1 changed file with 24 additions and 0 deletions.
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")

0 comments on commit 6307c88

Please sign in to comment.