#Password Checker Program
def lengthCheck(pWord):
if len(pWord) >= 6 and len(pWord) <= 12:
return True
else:
return False
def checkUpper(pWord):
for letters in pWord: #Why is my iteration not working?
upperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if upperLetters in pWord:
return True
else:
return False
def checkLower(pWord):
for letters in pWord: #Why is my iteration not working?
upperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
lowerLetters = upperLetters.lower()
if lowerLetters in pWord:
return True
else:
return False
def checkDigit(pWord):
for letters in pWord: #Why is my iteration not working?
digitNumbers = "0123456789"
if digitNumbers in pWord:
return True
else:
return False
def complexCheck(pWord):
if checkUpper(pWord) and checkLower(pWord) and checkDigit(pWord):
return True
else:
return False
def passCheck(pWord):
if lengthCheck(pWord) and complexCheck(pWord):
return True
else:
return False
goodPWord = True
pWord = ""
pWord = input("Please enter your password: ")
goodPWord = passCheck(pWord)
if goodPWord:
print(pWord, " is a good password.")
else:
print(pWord, " is not a good password")
我需要帮助解决这个问题,我自己不能犯错误,所以请帮助我。这是我学校的家庭作业,我需要帮助解决这个问题,我自己不能犯错误,所以请帮助我。这是我学校的家庭作业我需要帮助解决这个问题,我自己不能犯错误,所以请帮助我。这是我学校的家庭作业 在此处输入图像描述