Q:

Python program to calculate currency notes required to get the amount

belongs to collection: Python basic programs

0

Python program to calculate currency notes required to get the amount

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Python program to calculate currency notes

notes = (2000,500,200,100,50,20,10,5,2,1)

amount = int(input("Enter Amount to be paid : "))

for C in notes:
    count = amount//C
    print("Note Value : ", C,'\tnumber of notes ',count)
    amount = amount%C

Output:

Enter Amount to be paid : 34521
Note Value :  2000	number of notes  17
Note Value :  500 	number of notes  1
Note Value :  200 	number of notes  0
Note Value :  100 	number of notes  0
Note Value :  50 	number of notes  0
Note Value :  20 	number of notes  1
Note Value :  10 	number of notes  0
Note Value :  5 	number of notes  0
Note Value :  2 	number of notes  0
Note Value :  1 	number of notes  1

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Python basic programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Python program to calculate discount based on sell... >>
<< Python program to print table of number entered by...