Select Git revision
-
Jake Dreher authored
0-setup-initial-server - Create directory structure, .gitignore, etc. app.js is the entry point to the server, all actual logic should be contained within src.
Jake Dreher authored0-setup-initial-server - Create directory structure, .gitignore, etc. app.js is the entry point to the server, all actual logic should be contained within src.
password.py 710 B
def checkPassword(entry):
if len(entry) < 8:
return False
i = 0
digits = 0
lowers = 0
uppers = 0
special = 0
while i < len(entry):
ch = entry[i]
if ch.isdigit():
digits = digits + 1
elif ch.islower():
lowers = lowers + 1
elif ch.isupper():
uppers = uppers + 1
else:
special += 1
i = i + 1
if digits >= 1 and lowers >= 1 and uppers >= 1 and special >= 1:
return True
return False
entry = input("Enter your password: ")
result = checkPassword(entry)
if result:
print("Password meets all requirements")
else:
print("Password fails")