The ATM will dispense the required amount of money with min number of banknotes with the value 100, 50, 20, 10 and 5. Write a Python program for that purpose, the program will ask the required amount to the user. Test your code for 20, 65, 85, 190, 285. Make the program flexible by getting the five different values of banknotes from the user
Merhaba, hoş geldiniz.
Hangi konuda yardım istiyorsunuz?
1 Beğeni
money=int(input("how much money do you want?: "))
banknotes=[100,50,20,10,5]
i=0
while True:
try:
count=int(money/banknotes[i])
if count!=0:
print(count," Count: ",banknotes[i],"$")
money%=banknotes[i]
i+=1
except:
break
3 Beğeni
nasıl mavi şekilde gösterdiniz? Daha okunaklı olduğu için başka bir paylaşım yaparsam bunu kullanmak isterim.
"```(buraya herhangi bir şey mi yazmamız gerekiyor?)
"```
O mavi bölümlerin sebebi kodun yanlış renklendirilmiş olması, doğru renklendirme için dediğiniz yere python
yazmanız lazım.
Evet doğrusu o.
Biraz öznel olacak ama kısa satırlarla birine bir şey anlatmak istersem daha güzel görünür diye merak ettim.