def dna_digit(bp):
    """ Take a character (a string of length one) and return a
        0 for 'a', 1 for 'c', 2 for 'g', and 3 for 't'. For any
        other string, raise a ValueError. Capital or lowercase letters
        are acceptable.

        >>> dna_digit('a')
        0
        >>> dna_digit('C')
        1
        >>> dna_digit('g')
        2
        >>> dna_digit('t')
        3
        >>> dna_digit('abc')
        Traceback (most recent call last):
            ...
        ValueError: only 'a', 'c', 'g', or 't' accepted
        >>> dna_digit("")
        Traceback (most recent call last):
            ...
        ValueError: only 'a', 'c', 'g', or 't' accepted
    """
    # You must use the following dictionary:
    bp_map = {'a': 0, 'c': 1, 'g': 2, 't': 3}
    lower_bp = bp.lower()       # set all tests to lowercase to be evaluated same as upper case

    if lower_bp in bp_map:      # use dict in lowercase to make evaluation
        return bp_map[lower_bp]
    else:
        raise ValueError("only 'a', 'c', 'g', or 't' accepted")