
    Given a student's earned assessment points in one subject and total available points in another subject, determine the sum of all common learning checkpoints (divisors) between the two subjects to identify shared milestone opportunities. For example, if a student earned 12 points in Math (divisible by 1,2,3,4,6,12) and there are 18 total points in Science (divisible by 1,2,3,6,9,18), the sum of their common checkpoints (1,2,3,6) would help identify optimal cross-subject learning milestones.
    

    
def sum(a, b):
    """
    Given a student's earned assessment points in one subject and total available points in another subject, determine the sum of all common learning checkpoints (divisors) between the two subjects to identify shared milestone opportunities. For example, if a student earned 12 points in Math (divisible by 1,2,3,4,6,12) and there are 18 total points in Science (divisible by 1,2,3,6,9,18), the sum of their common checkpoints (1,2,3,6) would help identify optimal cross-subject learning milestones.
    

    """
def sum(a, b):
    """
    Given a student's earned assessment points in one subject and total available points in another subject, determine the sum of all common learning checkpoints (divisors) between the two subjects to identify shared milestone opportunities. For example, if a student earned 12 points in Math (divisible by 1,2,3,4,6,12) and there are 18 total points in Science (divisible by 1,2,3,6,9,18), the sum of their common checkpoints (1,2,3,6) would help identify optimal cross-subject learning milestones.
    

    """
    sum = 0
    for i in range(1, min(a, b)):
        if a % i == 0 and b % i == 0:
            sum += i
    return sum