[Tutor] Ingenious script (IMO)

Dick Moores rdmoores at gmail.com
Mon Aug 6 18:51:46 CEST 2007


On 8/6/07, Eric Brunson <brunson at brunson.com> wrote:
>
> Try something like:
>
> def makechange( amount, denominations ):
>
>     coins = {}
>     for d in denominations:
>         coins[d] = int( amount/d )
>         amount = amount%d
>
>     return coins
>
> Sorry, but could you spell out your point?

Dick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070806/6e75e795/attachment.htm 


More information about the Tutor mailing list