title: Populating dictionary from lists using condition
body: <p>As a beginner using Python, I'm trying to populate a dictionary with values using an if statement. If you have ideas as to why this isn't working, I would appreciate your input. Mahalo in advance!</p>
  
  <pre><code>#first list
  groslist = [0, 1, 2, 3]
  #dictionary whose keys are items in grosList
  grosdict = {k:[] for k in groslist}
  #second list whose items correspond with dictionary's keys
  indivlist = [0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3]
  #third list whose nth item ID corresponds indivlist
  indivIDlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
  
  #Populate dictionary with indivIDlist values (dict keys correspond with indivlist items)
  for ID in indivlist:
      for ID in groslist:
          x = 0;
          if indivlist[x] == groslist[x]:
              grosdict[indivlist[x]] = indivIDlist[x];
          x += 1
  </code></pre>
  
  <p>Here is my ideal output:</p>
  
  <pre><code>print CG_IDdict
  {0: [0, 1, 3], 1: [2, 4, 5, 6], 2: [7, 8, 9, 10], 3: [11, 12]}
  </code></pre>