¡@

Home 

python Programming Glossary: coins

Recursively find all coin combinations that produces a specified amount

http://stackoverflow.com/questions/9815077/recursively-find-all-coin-combinations-that-produces-a-specified-amount

This function can only contain two arguments amount and coins. I've had a difficult time wrapping my mind around recursion.. 50 20 10 5 UK 500 200 100 50 20 10 5 2 1 def change amount coins change 100 COINS 'USA' 293 if amount 0 return 0 elif amount.. 0 return 0 elif amount 0 return 1 else biggestcoin rest coins 0 coins 1 return change amount biggestcoin coins change amount..