title: python - insert values from one list into another at pre-defined spots
body: <p>In Python (3.5), if I have a long list like this:</p>
  
  <pre><code>long_list = ['0','1','0','1','0','0'.'0'.'1','1','0']
  </code></pre>
  
  <p>and a shorter list equal in length to the number of '1's in the long_list, like this:</p>
  
  <pre><code>short_list = [8,7,6,5]
  </code></pre>
  
  <p>How would I create a new list that "inserts" the values of my short_list into my long_list at each of the indices where there is a '1', and for consistency's sake, "replaces" the '0's in the long_list with some number (say 99).</p>
  
  <p>I could do this with an excruciating for loop, but it seems like there should be a way to do this more efficiently with a list comprehension, no?</p>
  
  <pre><code># bad solution
  new_list = []
  x = 0
  for i in range(len(long_list)):
      if long_list[i] == '0':
          new_list.append(99)
      else:
          new_list.append(short_list[x])
          x += 1
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>new_list = [99,8,99,7,99,99,99,6,5,99]
  </code></pre>