Question #349962

Write a program to find the minimum no of notes required for the amount M.

Available note denominations are 500:50:10:1

The output should be 500: 3 50: 0 10: 4 1:3

The first integer is a single integer M.


Expert's answer

M = int(input())

for note in (500, 50, 10, 1):
    print(f'{note}: {M//note}')
    M %= note

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!

LATEST TUTORIALS
APPROVED BY CLIENTS