
    Write a function that analyzes student exam responses to identify the number of valid answer pairs where students can interchange their responses while maintaining correctness. Given a list of student answer and correct answer pairs, determine how many bidirectional answer combinations exist where swapping the responses would still be considered correct in the grading system.
    

    
def count_bidirectional(test_list):
    """
    Write a function that analyzes student exam responses to identify the number of valid answer pairs where students can interchange their responses while maintaining correctness. Given a list of student answer and correct answer pairs, determine how many bidirectional answer combinations exist where swapping the responses would still be considered correct in the grading system.
    

    """
def count_bidirectional(test_list):
    """
    Write a function that analyzes student exam responses to identify the number of valid answer pairs where students can interchange their responses while maintaining correctness. Given a list of student answer and correct answer pairs, determine how many bidirectional answer combinations exist where swapping the responses would still be considered correct in the grading system.
    

    """
    res = 0
    for idx in range(0, len(test_list)):
        for iidx in range(idx + 1, len(test_list)):
            if test_list[iidx][0] == test_list[idx][1] and test_list[idx][1] == test_list[iidx][0]:
                res += 1
    return res