title: Python: floating point
body: <p>This is the code I typed:</p>
  
  <pre><code>s=0.0
  for i in range(10):
      s+=0.1
      print(s)
  </code></pre>
  
  <p>And this was the output:</p>
  
  <pre><code>0.1
  0.2
  0.30000000000000004
  0.4
  0.5
  0.6
  0.7
  0.7999999999999999
  0.8999999999999999
  0.9999999999999999
  </code></pre>
  
  <p>Can someone please explain why it becomes 0.7999999999999999 after 0.7?</p>
  
  <p>P.S : I know why it became 0.300...004</p>