Problem Statement:
The problem of denominations in python is very easy. The user gives us a total amount and we should count the number of currency notes to exchange that total amount. For example: if we are given a total amount of 475 then we should exchange it with 4 notes of 100s, 1 note of the 50s, 1 note of 20s, and 1 note of 5s.
Code for denominations in python:
total_amount = int(input("Enter your total amount: "))
list_of_notes = [1000, 500, 100, 50, 20, 10, 5]
for i in list_of_notes:
number_of_notes = total_amount // i
total_amount %= i
if number_of_notes != 0:
print(f"The number of notes of {i} is {number_of_notes}")
Output:


Also Read:
- Hyphenate Letters in Python
- Earthquake in Python | Easy Calculation
- Striped Rectangle in Python
- Perpendicular Words in Python
- Composite Number in Python
- Greatest Among Four Numbers in Python
- Reverse the sentence in Python
- Denominations in Python
- Min and max values in an array in JavaScript
- Keyboard events in JavaScript
- Reaching Ground Floor in Python
- Number of Moves in Python
- Starks Adventure in Python
- Neutralization in Python | Assignment Expert
- Free shipping in Python
- Raj has ordered two electronic items Python | Assignment Expert
- First Place in Python
- Triples with Properties in Python
- Nested list Indexing Python
- Team Points in Python
- Two words combination in Python
- ID Card in Python
- Cipher with a key in Python | Assignment Expert
- Multiple of 5 in Python
- Sandglass Star in Python
- Multiple of 3 in Python | Assignment Expert
- Ticket selling in Cricket Stadium using Python | Assignment Expert
- Sum of List Elements in Python
- All possible subsets in Python
- Names and Nicknames in Python