title: Python for loop only returning last value of a dictionary
body: <p>I'm trying to create a json dump with xyz coordinates in python, however the for loop im using to go trough different groups only returns the last group</p>
  
  <pre><code>self.group_strings = ['CHIN', 'L_EYE_BROW', 'R_EYE_BROW', 'L_EYE', 'R_EYE', 'T_NOSE', 'B_NOSE', 'O_LIPS', 'I_LIPS']
  
  if reply == QMessageBox.Yes:
     for grp_str in self.group_strings:
         coords_data = self.point_dict[grp_str]['Coords']
         data = coords_data
  
     with open("data_file.json", "w") as write_file:
         json.dump(data, write_file)
  </code></pre>
  
  <p>The expected outcome is a JSON file with the coordinates of the placed points as following:</p>
  
  <p>[[x,y,z][x,y,z][x,y,z][x,y,z][x,y,z][x,y,z]etc...].</p>
  
  <p>Every bracket for the placed point, the current out come is:</p>
  
  <p>[[x,y,z][x,y,z][x,y,z][x,y,z][x,y,z][x,y,z][x,y,z][x,y,z]].</p>
  
  <p>Only 8 values since the size of the last group is 8</p>
  
  <p>After trying some of your solutions I've ended up with this:</p>
  
  <pre><code>data = []
  if reply == QMessageBox.Yes:
      for grp_str in self.group_strings:
          data.append(self.point_dict[grp_str]['Coords'])
  
          with open("data_file.json", "w") as write_file:
              json.dump(data, write_file)
  </code></pre>
  
  <p>The output of print(data) is:</p>
  
  <blockquote>
    <p>[[17.006101346674598, -24.222496770994944, 95.14869919154683], [22.30318006424494, -21.376267007401097, 94.70820903177969], [-24.066693590510965, 21.205230021220736, 96.57992975278633], [-7.9541006992288885, 20.3986457061961, 103.06739548846576], [-28.291138300128495, 33.5422782651503, 99.22546203301508], [-40.61999270785583, 40.90496355476136, 90.2356807538543], [-39.293698815625135, 52.39636618754361, 96.72998820004932], [-28.29463915487483, 48.772250886978405, 102.25119515066885]]</p>
  </blockquote>