import string


def ascii_freq(a: bytearray) -> float:
    """Return the frequency of valid ascii characters in a bytearray.

    Arguments:
        a {bytearray} -- Bytearray to test against

    Returns:
        float -- Frequency of valid ascii in a bytearray
    """
    total = len(a)

    ascii_chars = 0
    for i in range(total):
        if chr(a[i]) in string.ascii_letters:
            ascii_chars += 1
    return ascii_chars / total