The possible denominations of currency notes are 100, 50, 20 and 10. The amount A to be withdrawn is given as input.
Write a program to break the amount into minimum number of bank notes.
The first line of input is an integer A.
Output
The output should be a string representing number of 100, 50, 20, 10 notes possible.
Explanation
In the given example amount 370, it can be written as
370 = 3*(100) + 1*(50) + 1*(20) + 0*(10)
Then the output should be
100 Notes: 3
50 Notes: 1
20 Notes: 1
10 Notes: 0
def count(A):
notes = [100, 50, 20, 10]
note_count = [0, 0, 0, 0]
for i, j in zip(notes, note_count):
j = A // i
A = A - j * i
print (i ,"Notes: ", j)
amount =int(input("Enter Amount: "))
count(amount)
Comments
Leave a comment