title: If statements in a for loop
body: <p>I have a problem with some if statements in a for loop. Here is my code:</p>
  
  <pre><code>import numpy as np
  
  mv = []
  mb = []
  mbv = []
  M = []
  for i in range (0,25):
      mv.append(10.1 - 2.5 * np.log10(fv[i]/1220000))
      mb.append(11.0 - 2.5 * np.log10(fb[i]/339368))
      mbv.append(mb[i]-mv[i])
      if ( 0.00 &lt; mbv[i] &lt; 0.05):
          M.append(1.1)
      if ( 0.05 &lt; mbv[i] &lt; 0.1):
          M.append(1.8)
      if ( 0.1 &lt; mbv[i] &lt; 0.2):
          M.append(2.2)
      else:
          M.append(0)
      print i+1, mbv[i], M[i]
  </code></pre>
  
  <p>This is what I get as a result:</p>
  
  <pre><code>1 0.117517744922 2.2
  
  2 0.105291760392 2.2
  
  3 0.0414704330434 1.1
  
  4 0.709631736921 0
  
  5 0.0634562921955 0
  
  6 0.9 1.8
  
  7 0.123732441181 0
  
  8 0.332213182737 0
  
  9 0.0783116509167 2.2
  
  10 0.109696428387 0
  
  11 0.812457966075 1.8
  
  12 0.0796972381532 0
  
  13 0.0933833026562 2.2
  
  14 0.0448112197058 0
  
  15 0.107871295045 1.8
  
  16 0.072180255058 0
  
  17 0.134980217798 1.8
  
  18 0.453454266409 0
  
  19 0.0498332192697 1.1
  
  20 0.141914194517 0
  
  21 0.0712870748016 2.2
  
  22 0.622521992135 1.8
  
  23 0.176515236738 0
  
  24 0.607814524935 2.2
  
  25 0.0521329729172 0
  
  0
  </code></pre>
  
  <p>As you can see number 5 has an mbv of 0.0634, this should give an M of 1.8 but instead it gets an 0. </p>
  
  <p>Thanks in advance for your help</p>