Computer Science, asked by tia737, 4 months ago

write a python program whichan amount and then breaks the amount into all possible denominations and print the number of each denominations ​

Answers

Answered by valeriy69
1

amount = int(input("Enter amount: "))

denominations = {

2000: 0,

500: 0,

100: 0,

50: 0,

20: 0,

10: 0,

5: 0

}

for k, v in denominations.items():

if amount >= k:

denominations[k] = amount // k

amount = amount - denominations[k] * k

print(f"Rs {k}: {denominations[k]}")

# only uses notes

\footnotesize\underline\mathsf\color{yellow}{Choose\: brainliest\: if\: it\: helped.}

Similar questions