title: Why does '0.00' compare as not equal to 0 in this Python code?
body: <p>What is wrong with my IF ELSE statement? </p>
  
  <p>IF NOT condition, do A.
  ELSE, do B.</p>
  
  <p>But the result turns out quite different than I expected. :S</p>
  
  <pre><code>data['stock'] = ['0.02', '0.03', '0.04', '0.00', '0.05', '0.04', '0.05']
  
  x = 0
  y = len(data['Keywords'])
  
  while x &lt;= y - 1:
      if data['stock'][x] != 0:
          print data["stock"][x]
          a = a + 1
      else:
          print "hello"
          a = a + 1
  
  Output:
  0.02
  0.03
  0.04
  0.00
  0.05
  0.04
  0.05
  </code></pre>