title: Updating a list within a loop by applying a function
body: <p>I'm trying to write a simple loop in Python. Here's the code:</p>
  
  <pre><code>N = 1000
  
  xrange = np.arange(-1.0,0.0,1.0/N)
  drange = 1.0 + xrange
  yrange = np.zeros(N)
  
  range = np.arange(0,N,1)
  
  for i in range:
      if drange[i] == 1.0:
          yrange[i] == 1.0
      else:
          yrange[i] == np.log(drange[i])/(drange[i] - 1.0)
  
  print(yrange)
  </code></pre>
  
  <p>However after the <code>for</code> loop has run, the list <code>yrange</code> doesn't get updated. It still has all values at zero. </p>
  
  <p>Is there anything wrong with the <code>else:</code> part of the loop?</p>