title: error: 'str' object has no attribute 'update' when adding key to dict
body: <p>quite a newbie question, so please bear with me....</p>
  
  <p>i'm using python 2.7.8 with Django 1.7.1.</p>
  
  <p>i'm trying to add a key to a dict within a for loop.</p>
  
  <pre><code>courseProgress =  dict()
  for child in children:
      courseProgress[child.id] = str(child.child_firstname)
  for individualCourse in allCourses:
      #get the total number of items within a course
      totalContentsCount = len(courseContents[individualCourse.course_id])
      #get the total number of completed steps for this course from the rewardHistory that we obtained earlier
      thisCourseProgress = len(allCourses.filter(course = individualCourse.course_id))
      #divide to get a percentage
      thisProgress = float(thisCourseProgress) / float(totalContentsCount)
      currentCourseID = int(individualCourse.course_id)
      thisCourse = {
          'progress' : thisProgress,
          'courseInfo' : courseContents[currentCourseID]
          }
      courseProgress[individualCourse.child.id].update({currentCourseID : thisCourse})
  </code></pre>
  
  <p>the last line generates the error: <strong>error: 'str' object has no attribute 'update'</strong></p>
  
  <p>obviously(?) it's seeing courseProgress[individualCourse.child.id] as a string and not as a key within a dictionary to which i'm trying to add a child key. I think this is because i'm getting the value returned (which is a string). Within an interactive prompt i get the following:</p>
  
  <pre><code>&gt;&gt;&gt;courseProgress[individualCourse.child.id]
  'Sophie'
  </code></pre>
  
  <p>I'm not sure why this is...</p>
  
  <p><strong>The result i'm after</strong> is to add a child key to <code>courseProgress[individualCourse.child.id]</code> (e.g. <code>courseProgress[1]</code> ), and that child key would be in the eventual format of <code>{1 : thisCourse}</code></p>
  
  <p>What am I doing wrong?</p>