title: Why does Python while loop does not function properly
body: <p>I am running a while loop and couldn't debug the below code. Can you please help?</p>
  
  <pre><code>import numpy as np
  np.random.seed(1)
  
  VVV = list(np.random.uniform(100, 10000, 500))
  muj = [1/(VVV[j]*(1/70)/year/hour) for j in range(500)]
  wj = list(np.random.uniform(1, 5, 500))
  rholist = list(np.random.uniform(0, 0.02, 500))
  lambdaj = [rholist[i]*muj[i]/wj[i] for i in range(500)]
  tauIj = list(np.random.uniform(20/year, 40/year, 500))
  
  for j in range(500):
      while lambdaj[j]&gt;0.17 or lambdaj[j]&lt;0.0005 or tauIj[j]*lambdaj[j] &gt;= 1:
          rholist = list(np.random.uniform(0, 0.02, 500))
          lambdaj = [rholist[i]*muj[i]/wj[i] for i in range(500)]
          tauIj = list(np.random.uniform(20/year, 40/year, 500))
  </code></pre>
  
  <p>I create <code>VVV</code>, <code>muj</code>, <code>wj</code>, and <code>rholist</code> first. Then, I want to create a  <code>lambdaj</code> and <code>tauIj</code> lists satisfying that each element of <code>lambdaj</code> is bounded by <code>0.0005</code> and <code>0.17</code> and crossproduct of each element in <code>tauIj</code> and <code>lambdaj</code> is strictly less than <code>1</code>. I do not know where I am doing wrong. BTW, I intentionally resample the whole list even if one item in the list does not satisfy these conditions.</p>