Your users passwords were all stole in the Yahoo! hack, and it turns out they have been lax in creating secure passwords.  Create a function that checks their new password (passed as a string) to make sure it meets the following requirements:
Between 8 - 20 characters
Contains only the following characters: (and at least one character from each category): uppercase letters, lowercase letters, digits, and the special characters !@#$%^&*?
Return "valid" if passed or else "not valid"
import re
def check_password(s):
    if len(s) > 20 or len(s) < 8: return "not valid"
    a1 = bool(re.search(r'[A-Z]', s))
    a2 = bool(re.search(r'[a-z]', s))
    a3 = bool(re.search(r'\d', s))
    a4 = bool(re.search(r'[!@#$%^&*?]', s))
    a5 = bool(re.search(r'^[A-Za-z!@#$%^&*?\d]*$', s))
    return "valid" if a1*a2*a3*a4*a5 else "not valid"
import re
def check_password(s):
    if len(s) > 20 or len(s) < 8: return "not valid"
    a1 = bool(re.search(r'[A-Z]', s))
    a2 = bool(re.search(r'[a-z]', s))
    a3 = bool(re.search(r'\d', s))
    a4 = bool(re.search(r'[!@#$%^&*?]', s))
    a5 = bool(re.search(r'^[A-Za-z!@#$%^&*?\d]*$', s))
    return "valid" if a1*a2*a3*a4*a5 else "not valid"