Computer Science, asked by javed55621, 1 year ago

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 praveenyatakari
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