given an amount write a program in python to find a minimum number of currency notes of different denominations that sum to the given amount. Available note denominations are 1000, 500, 100, 50, 20, 5, 1.
# you can add amounts to find a minimum number of currency
numbers = (1000, 500, 100, 50, 20, 5, 1)
amount = int(input('amount = '))
output = {}
for n in numbers:
output[n] = amount // n
amount %= n
for x, y in output.items():
print(x, y, sep=':')
Comments
Leave a comment