def loadSubjects(filename):
    """
    Returns a dictionary mapping subject name to (value, work), where the name
    is a string and the value and work are integers. The subject information is
    read from the file named by the string filename. Each line of the file
    contains a string of the form "name,value,work".

    returns: dictionary mapping subject name to (value, work)
    """

    inputFile = open(filename)
    subjects = {}
    list_of_keys = []
    list_of_tuples = []
    for line in inputFile:
        list_of_keys.append(line.split(',')[0].strip())
        list_of_tuples.append((int(line.split(',')[1].strip()), int(line.split(',')[2].strip())))
    for n in range(len(list_of_keys)):
            subjects[list_of_keys[n]] = list_of_tuples[n]
    return subjects