我有多个有时具有相同值的变量,但并非总是如此,如何指定要使用python的函数的哪一部分

我有以下代码:

A = B = C = D = E = 1
def pointscalcwomen(value):
    if value == AWomen:
        print("AWomen")
        if value < 12:
            womenspoints = 105 - 5 * (int(AWomen))
        elif value < 61:
            womenspoints = 61 - AWomen
        else:
            womenspoints = 1
    elif value == BWomen:
        print("BWomen")
        if value < 7:
            womenspoints = 80 - 5 * (int(BWomen))
        elif value < 56:
            womenspoints = 56 - BWomen
        else:
            womenspoints = 1
    elif value == Cw:
        print("Cw")
        if value < 51:
            womenspoints = 51 - Cw
        else:
            womenspoints = 1
    elif value == D:
        print("DWomen")
        if value < 31:
            womenspoints = 31 - DWomen
        else:
            womenspoints = 1
    elif value == EWomen:
        print("EWomen")
        if value < 12:
            womenspoints = 105 - 5 * (int(EWomen))
        elif value < 61:
            womenspoints = 61 - EWomen
        else:
            womenspoints = 1
    return womenspoints
for row in reader:
    if "A" in row[0]:
        points = pointscalcwomen(AWomen)
        print(points)
        A = A + 1
    elif "B" in row[0]:
        points = pointscalcwomen(BWomen)
        print(points)
        B = B + 1
    elif "C" in row[0]:
        points = pointscalcwomen(CWomen)
        print(points)
        C = C + 1
    elif "D" in row[0]:
        points = pointscalcwomen(DWomen)
        print(points)
       D = D + 1
    elif "E" in row[0]:
        points = pointscalcwomen(EWomen)
        print(points)
        E = E + 1

However, I am facing the problem that if A is never in row[0], then the first B will get 100 points, not 75 etc. This is because at that point value == AWomen == BWomen, is there a way to get around this. I have thought of changing my code to something like:

elif "B" in row[0]:
    A = 10000
    points = pointscalcwomen(BWomen)
    B = B + 1

这将使脚本大部分时间都可以正常工作,因为CSV行[0]通常遵循以下模式:

A
A
A
A
B
B
B
C
C

但是,如果存在这种情况:

A
A
B
A
B
B

那么它将不起作用,因为在第四行中被B击败的A将获得1分而不是90分。