title: How to do maths with floats in Python without ending up with 10+ decimal points?
body: <p>I'm writing code to calculate how to pay an amount in $100, $50, $20 etc. notes and coins. The code looks something like this (just for $100 at the moment):</p>
  <pre><code>hundred = 0
  amount = float(input('Value: '))
  if amount // 100 &gt;= 1:
      hundred += amount // 100
      amount -= (hundred * 100)
      print(amount)
  </code></pre>
  <p>If I input with just 100, I'm left with 0 which is great. If I input another whole number such as 104, I'm left with 4 which is also correct. However, if I input something like 100.4, instead of being left with 0.4, it prints a very long decimal number (0.4000000000000057) which won't work with the rest of my code. How can I make it so the amount left to pay is only 0.4?</p>