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
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
Comments
Leave a comment