def has_abba(code):
    """Checks for existence of a 4-letter palindromic substring within `code`
    The palindromic substring must contain 2 unique characters
    """
    palindrome = None
    for i in range(len(code) - 4 + 1):
        # substring = code[i:i + 4]
        if code[i] == code[i + 3] and code[i + 1] == code[i + 2]:
            palindrome = code[i:i + 4]
            break

    result = palindrome and len(set([c for c in palindrome])) == 2
    return result