Answer to Question #220931 in Python for Hari nadh babu

Question #220931

Denominations - 2

Write a Python program of Denominations - 2. It consists of two test cases


The below link contains Denominations - 2 - Question, explanation and test cases


https://drive.google.com/file/d/1DDPxBvRR7xx5Mbm68ThgRUe0h6QoOrQB/view?usp=sharing


We need all test caese can be come while code was running

1
Expert's answer
2021-07-31T07:16:06-0400
notes = [100, 50, 20, 10]
n = int(input('Enter currency here:'))
for I in notes:
    if n >= I:
        s = n//I
        n = n-(s*I)
        print (str(I)+' ' +'notes' ," : ", s)

Enter currency here:370
100 notes  :  3
50 notes  :  1
20 notes  :  1



Enter currency here:130
100 notes  :  1
20 notes  :  1
10 notes  :  1

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS