Consider a currency system in which there are notes of seven denominations, namely, rs. 1, rs. 2, rs. 5, rs. 10, rs. 50, rs. 100. If the change given to pranav rs. N is input, write a program to computer smallest number of notes that will combine to give rs. N.
Answers
Answered by
4
Answer:
def countCurrency(amount):
notes = [2000, 500, 200, 100,
50, 20, 10, 5, 1]
noteCounter = [0, 0, 0, 0, 0,
0, 0, 0, 0]
print ("Currency Count -> ")
for i, j in zip(notes, noteCounter):
if amount >= i:
j = amount // i
amount = amount - j * i
print (i ," : ", j)
Explanation:
Similar questions
Math,
6 months ago
Math,
6 months ago
Business Studies,
1 year ago
Political Science,
1 year ago
History,
1 year ago
Social Sciences,
1 year ago
History,
1 year ago