def translate(sequence, gct):
    """
    For a DNA sequence, translate it into a sequence of one symbol per codon, following 
    a specific translation table. For example, this could be translating DNA sequence into
    an amino acid sequence following some genetic code, or it could be mapping the DNA 
    sequence to a sequence of symbols corresponding to each codon. Replaces values not in 
    the translation dict with X's
    
    Args:
        sequence (string): DNA sequence of A, T, G, C characters
        gc (dict): translation table
    Returns:
        string: new sequence of symbols, 1/3 length of DNA sequence
    
    """
    return ''.join([gct.get(sequence[3*i:3*i+3].upper(),'X') for i in range(len(sequence)//3)])