change(amount) returning a dict denomination → count using the greedy algorithm (largest first), omitting zero-count notes. (Greedy is optimal for this canonical system — worth stating.)change(3876)
{2000: 1, 500: 3, 200: 1, 100: 1, 50: 1, 20: 1, 5: 1, 1: 1}Largest notes first minimizes the count.
Loop the denomination list in order.
count, amount = divmod(amount, note).