# Name: checkPass.py # Author: Prof. Neary # Date: 9/25/2018 # Section: All # Description: # This program will continue looping until the user # enters a password that is between 8 and 20 chars # long # MIN_LEN = 8 MAX_LEN = 20 def main(): print("Welcome to the password checker!") # set my boolean flag to reflect bad input flag = False # so long as the input is bad, loop for more input while not flag: # set the flag to assume that the reqs are satisfied flag = True password = input("Enter a password: ") # if the password is less than the minimum length, it's bad if len(password) < MIN_LEN: print(password, "is too small!") #set the flag to reflect a bad password flag = False # if the pasword is bigger than the maximum length, it's bad if len(password) > MAX_LEN: print(password, "is too large!") #set the flag to reflect a bad password flag = False main()