title: TypeError: 'float' object is not iterable, Python list
body: <p>I am writing a program in Python and am trying to extend a list as such:</p>
  
  <pre><code>spectrum_mass[second] = [1.0, 2.0, 3.0]
  spectrum_intensity[second] = [4.0, 5.0, 6.0]
  spectrum_mass[first] = [1.0, 34.0, 35.0]
  spectrum_intensity[second] = [7.0, 8.0, 9.0]
  
  for i in spectrum_mass[second]:
      if i not in spectrum_mass[first]:
          spectrum_intensity[first].extend(spectrum_intensity[second][spectrum_mass[second].index(i)])
          spectrum_mass[first].extend(i)
  </code></pre>
  
  <p>However when I try doing this I am getting <code>TypeError: 'float' object is not iterable
  </code> on line 3. </p>
  
  <p>To be clear, <code>spectrum_mass[second]</code> is a list (that is in a dictionary, second and first are the keys), as is <code>spectrum_intensity[first]</code>, <code>spectrum_intensity[second]</code> and <code>spectrum_mass[second]</code>. All lists contain floats.</p>