title: cash note looking for small change of coin equally
body: <p>Problem: i have cash in my hand, with this programming, i would get small changes of coin equally,
  e.g. coin = [0.5, 0.2, 0.1]
  if i have $2, system would return to me $0.5: 1unit, $0.2: 3 unit, $0.1: 4 unit</p>
  <h1>system wont goes all to $0.5, but will allocate to different face value of coin</h1>
  <p>code didnt functioning, no looping and end.</p>
  <pre><code>amount = int(input(&quot;enter money: &quot;))
  
  global ncoin
  global coin
  
  def payCash(amount):
  
    coin = [5, 2, 1]
    ncoin = [0, 0, 0]
    while amount &gt; 0:
       for cash in (coin):
          if amount - int(cash) &gt; 0:
               amount = amount - cash
              if cash == 5:
                  ncoin[0] += 1
              elif cash == 2:
                  ncoin[1] += 1
              else:
                  ncoin[2] += 1
  
    print(&quot;$5:&quot; , ncoin[0] , &quot; $2:&quot; , ncoin[1] , &quot; 1:&quot; , ncoin[2])
  
  print(&quot;money&quot;)
  </code></pre>
  <p>error:</p>
  <pre><code>enter money: 20
  money
  
  Process finished with exit code 0
  </code></pre>