title: issue with while loop in python
body: <p>I am unable to figure out why the while loop in the following program
  always stops after 1 iteration. Basically how is weightsPrevious becoming 
  equal to weights after one iteration regardless of the input. Basically I want
  to keep track of weights list for two consecutive runs and if they are equal
  I want to exit. If I use a for loop with a fixed large number of iterations, I see
  that consecutive weights lists are not equal in the first iteration, yet the while loop always
  quits after one. Any help will be appreciated.</p>
  
  <pre><code>import random
  
  def test(inputs, targets):
      inputDim = len(inputs[0])
      outputDim = len(targets[0])
      if (len(inputs) == len(targets)):
          dataSize = len(inputs)
      else:
          return
  
      weights = [];
  
      for i in range(inputDim + 1):
          weights.append([]);
          for j in range(outputDim):
              weights[i].append(2*random.random() - 1);
  
      weightsPrevious = 0
  
      iterCount = 0
      while (weightsPrevious != weights):
          iterCount += 1
          print("iteration", iterCount)
          weightsPrevious = weights.copy()
          for k in range(dataSize):
              for j in range(outputDim):
                  weights[0][j] += 0.25*(targets[k][j] - 1)*(-1)
                  for i in range(inputDim):
                      weights[i + 1][j] += 0.25*(targets[k][j] - 1)*inputs[k][i]
  
          return weights
  
  test([[0,0],[0,1],[1,0],[1,1]],[[0],[1],[1],[1]])
  </code></pre>
  
  <p>EDIT: I get the same result even after removing the last return statement</p>