
    Create a function that analyzes a sequence of historical credit risk ratings and determines how many times a specific risk threshold value appears in the assessment history. The function should accept a tuple containing previous credit risk scores and a target risk rating value as inputs.
    

    
def count_X(tup, x):
    """
    Create a function that analyzes a sequence of historical credit risk ratings and determines how many times a specific risk threshold value appears in the assessment history. The function should accept a tuple containing previous credit risk scores and a target risk rating value as inputs.
    

    """
def count_X(tup, x):
    """
    Create a function that analyzes a sequence of historical credit risk ratings and determines how many times a specific risk threshold value appears in the assessment history. The function should accept a tuple containing previous credit risk scores and a target risk rating value as inputs.
    

    """
    count = 0
    for ele in tup:
        if ele == x:
            count = count + 1
    return count