title: Python - Receipt-like output
body: <p>Im doing some homework and im breaking my head around this.. either im stupid, or im just way too tired to do this.. I managed to get the output right and prioritized, but when i enter a float number, it will just go crazy.. 
  The overall goal is to be able to enter a float value which will work.. i just can't seem to get my head around a mathematical solution</p>
  
  <pre><code>price = input("Enter Price ")
  cash = input("Enter Cash ")
  coins = [100, 50, 20, 10, 5, 1, 0.5]
  change = cash-price
  i = 0
  while i&lt;len(coins):
      print int(change/coins[i]),str(" X "),coins[0+i]
      if change&gt;0:
          change = change-((change/coins[i])*coins[i])
      else:
          change = max(change,0)
      i=i+1
  </code></pre>
  
  <p>Thanks !</p>