title: How to modify two inter-related lists simultaneously?
body: <p>I have two blank lists: <code>intitialList</code> and <code>finalList</code> and one initial value which is supposed to go into the <code>initialList</code> and a sample list <code>sampleList = [12,3,1,4,25,3,2,22,12,32,34,2,1,5,7]</code>. Now what I want to do is to write a program that will first insert initial values in the <code>initialList</code> then do some calculations and insert the value in <code>finalList</code> and then the first values of the <code>finalList</code> become the 2nd value of the <code>initialList</code> and again do some calculation and so on. Its kind of zigzag thing. Values are filling in zigzag way. My approach:</p>
  
  <pre><code>intialList = []
  finalList = []
  intialValue = 30
  eff = 0.25
  sampleList = [12,3,1,4,25,3,2,22,12,32,34,2,1,5,7]
  for a in sampleList:
      if a &lt; 10:
          intialList.append(intialValue)
          finalList.append(intialValue + intialValue*eff)
      else:
          intialList.append(intialValue)
          finalList.append(intialValue - intialValue*eff)
  print("initial list:", intialList)
  print("final list:", finalList)
  </code></pre>
  
  <p>I seriously don't know how to approach this. 
  desired output:</p>
  
  <pre><code>initial list: [30, 22.5, 28.125, 35.156, 43.954, 32.96, 24.72]
  finalist list: [22.5, 28.125, 35.156, 43.945, 32.96, 24.72] 
  </code></pre>
  
  <p>the results are stored in the <code>finalList</code> and first the <code>initial value</code> is stored at the index 0  of <code>initialList</code> after that the final result from the <code>finalList</code> is stored in the <code>initialList</code>. </p>