×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Python program to calculate currency notes required to get the amount

Currency Program in Python: In this tutorial, we will learn how to write a Python program to calculate currency notes required to get the amount? By Shivang Yadav Last updated : January 13, 2024

Problem statement

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

RUN 1:
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

RUN 2:
Enter Amount to be paid : 10801
Note Value :  2000      number of notes  5
Note Value :  500       number of notes  1
Note Value :  200       number of notes  1
Note Value :  100       number of notes  1
Note Value :  50        number of notes  0
Note Value :  20        number of notes  0
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

To understand the above program, you should have the basic knowledge of the following Python topics:

Python Basic Programs »

Advertisement
Advertisement

Related Programs

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.