Write a python program to input money in Bahrain dinar and find out number of denominations can be used to make that money.

For example: -
Enter total money in BD: 76
Then the output Should be :
No.of 20 BD : 3
No.of 10 BD : 1
No.of 5 BD : 1
No.of 1 BD : 1

Pls answer fast

Respuesta :

n = int(input("Enter total money in BD: "))

n20 = n//20

n10 = (n-(n20*20))//10

n5 = (n - ((n20*20)+(n10*10)))//5

n1 = (n - ((n20*20)+(n10*10) + (n5*5)))//1

print("No. of 20 BD: "+str(n20))

print("No. of 10 BD: "+str(n10))

print("No. of 5 BD: "+str(n5))

print("No. of 1 BD: "+str(n1))

Ver imagen Cytokine