def mutate(codon, alt, index):
    """
    Replace (mutate) a base in a codon with an 
    alternate base. 
        
    Parameters
    ----------
    codon : str
        three letter DNA sequence
        
    alt : str
        alternative base
        
    index : int
        index of the alt base in codon (0|1|2). 

    Returns
    -------
    str
        codon with alternative base

    Raises
    ------
    AssertionError
        error if index is not valid (0|1|2)
        
    AssertionError
        error if base is not valid (A|T|C|G)
        
    """
    
    assert index in [0,1,2], "Not a valid index."
    
    assert alt in ["A", "T", "C", "G"], "Not a valid base."
    
    return "".join([alt if i == index else b for i,b in enumerate(codon)])