import re
def isLength(pw):
if len(pw) 8:
print(‘The password is too short.’)
return False
else:
return True
def isUp(pw):
upRegex re.compile(r’.[A-Z].’)
return upRegex.search(pw)
def isLow(pw):
lowRegex re.compile(r’.[a-z].’)
return lowRegex.search(pw)
def isNum(pw):
numRegex re.compile(r’.[0-9].’)
return numRegex.search(pw)
def isStrongpw(pw):
if isNum(pw) and isLow(pw) and isUp(pw):
print(‘This is a strong password.’)
return True
else:
print(‘This is not a strong password.’)
return False
while True:
print(‘Please input your password:’)
pw input()
if isStrongpw(pw):
break



