ADVERTISEMENT
ADVERTISEMENT

Python program to calculate currency notes required to get the amount

Here, we are going to write a Python program to calculate currency notes required to get the amount.
Submitted by Shivang Yadav, on March 01, 2021

We are given two total amounts. We need to find the number of currency notes required to be given.

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

Python Basic Programs »



ADVERTISEMENT


ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.