Q:

keep getting syntax error in python

I'm doing the MIT open courseware class 6.00 Introduction to Computer Science and Programming and I'm stucked in the problem 2 of the 8th assignment where I'm supposed to create a greedy algorithm to give students the best subjects possible depending on a value, work relationship. 
this is the part of my code where i get a syntax error and can't seem to figure out what's wrong:
subjects={'6.00':   (16,   8),'1.00':   (7,    7),'6.01':   (5,    3), '15.01':  (9,    6)}

def greedyAdvisor(subjects, maxWork, comparator):
    """
    Returns a dictionary mapping subject name to (value, work) which includes
    subjects selected by the algorithm, such that the total work of subjects in
    the dictionary is not greater than maxWork.  The subjects are chosen using
    a greedy algorithm.  The subjects dictionary should not be mutated.

    subjects: dictionary mapping subject name to (value, work)
    maxWork: int >= 0
    comparator: function taking two tuples and returning a bool
    returns: dictionary mapping subject name to (value, work)
    """

    bestSubjects={}
    currentWork=0
    NA=['0']
    while currentWork<maxWork:
        candidate=find_best_sub(subjects,comparator)
        candidate_work= find_work(candidate)
        if candidate_work+currentWork<=15:
          d2={candidate:subjects[candidate]
          NA.append(candidate)
          bestSubjects.update(d2)
          currentWork+=candidate_work
        elif candidate_work+currentWork>15:
              continue
      return bestSubjects

def find_best_sub(subjects,comparator, NA):
    """returns the best subject according to a comparator, the subject must be available so if it's in the NA list it wont be considered"""
  subs= subjects.keys()
  subs=list(subs)
  best_subject='1.00'
  for subject in subs:
    if subject not in NA:
        if comparator(subjects[subject],subjects[best_subject])== True:
          best_subject= subject
        elif comparator(subjects[subject],subjects[best_subject])== False:
          continue
  return best_subject

def find_work(subjects,sub):
  work=sub[WORK]
  return work

A:

As can often happen, the erroring line is one above the one being reported:
      d2={candidate:subjects[candidate]
      NA.append(candidate)

In this case you aren't closing the brace in d2 declaration
      d2={candidate:subjects[candidate]} #<--- here
      NA.append(candidate)

