def n_char(record:str, char="", digit=False):
    """
    This function get the number of characters of certain kind from a string
    """
    if digit or char!="":
        if digit:
            n = len([k for k in record if k.isdigit()])
        else:
            n = len([k for k in record if k==char])
    else:
        raise ValueError("Please select a character")
    return n