charset_report(password) using the string module's constants (ascii_lowercase, ascii_uppercase, digits, punctuation) to return a dict of four booleans: lower, upper, digit, symbol — whether the password contains at least one character from each class.charset_report('Ab3!'){'lower': True, 'upper': True, 'digit': True, 'symbol': True}One of each class is present.
any(c in string.digits for c in password).
Four similar any() expressions complete the dict.