Answer to Question #220934 in Python for Hari nadh babu

Question #220934

Denominations - 3

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


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


https://drive.google.com/file/d/1W-q6iUJbpoqxvZBPcGPX7afOYu73Veui/view?usp=sharing


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

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

Enter currency here:1543
500:  3
10:  4
1:  3

Enter currency here:1259
500:  2
50:  5
1:  9


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