Try this Small Code Program to Count Total Number of Notes in Given Amount using Loop
#Program to Count Total Number of Notes in Given Amount using Loop
#code by RakeshMgs
notes = (2000,500,200,100,50,20,10,5,2,1)
amt = int(input("Enter Your Amount : "))
#Enter 2888 in ammount for count all notes minimum 1 time
for n in notes:
counts = amt//n
print("use",counts,"notes of\t",n,"₹")
amt = amt%n
Python Code Tutorial: Calculating the Total Number of Notes using if condtion
#Program to Count Total numbers of notes in given amount
amt=int(input("Enter Amount\n"))
note500=note100=note50=note20=note10=note5=note2=note1=0
if amt>=500:
note500=amt//500
amt=amt-note500*500
if amt>=100:
note100=amt//100
amt=amt-note100*100
if amt>=50:
note50=amt//50
amt=amt-note50*50
if amt>=20:
note20=amt//20
amt=amt-note20*20
if amt>=10:
note10=amt//10
amt=amt-note10*10
if amt>=5:
note5=amt//5
amt=amt-note5*5
if amt>=2:
note2=amt//2
amt=amt-note2*2
if amt>=1:
note1=amt//1
amt=amt-note1*1
print("500 \t=\t",note500)print("100 \t= \t",note100)print("50 \t= \t",note50)print("20 \t= \t",note20)print("10 \t= \t",note10)print("5 \t= \t",note5)print("2 \t= \t",note2)print("1 \t= \t",note1)
Output:
Python Program to Calculate Currency Notes for a Given Amount,
Counting Currency Notes with Python: A Step-by-Step Guide,
Automating Note Counting in Python for Any Given Amount,
How to Write a Python Script to Determine the Number of Notes in an Amount,
Developing a Python Algorithm to Count Currency Notes Efficiently,
Python Code Tutorial: Calculating the Total Number of Notes,
Creating a Currency Note Counter in Python,
Step-by-Step Python Program to Count Notes in a Given Amount,
Building a Python Application to Count Money Notes,
Optimizing Note Counting for Different Denominations in Python
HomePythonProgram to Count Total Number of Notes in Given Amount | Python Program to Calculate Currency Notes
0 Comments
Please don't Add spam links,
if you want backlinks from my blog contact me on rakeshmgs.in@gmail.com