title: Unexpected amount of decimal places in Python
body: <p>I'm fairly new to Python and I came across an interesting issue when I was testing out some of the functions. Below is a snippet of the test code I'm running. My intent is to print out a price list of an item according to its weight range.</p>
  
  <pre><code>price = 0.2
  
  for x in range(1,4):
      print("%sKG to %sKG: $%s to $%s" % ((x)*10, (x+1)*10, (x)*price, (x+1)*price))
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>10KG to 20KG: $0.2 to $0.4
  20KG to 30KG: $0.4 to $0.6
  30KG to 40KG: $0.6 to $0.8
  </code></pre>
  
  <p>Actual output:</p>
  
  <pre><code>10KG to 20KG: $0.2 to $0.4
  20KG to 30KG: $0.4 to $0.6000000000000001
  30KG to 40KG: $0.6000000000000001 to $0.8
  </code></pre>
  
  <p>The issue disappears once I change the format to "%.1f". My question is, does anyone know why are there so many decimal places in the $0.6 value? </p>