bot50 2024-03-22 08:45:19 +00:00
commit 1298b792cf
1 changed files with 24 additions and 0 deletions

24
cash.py Normal file
View File

@ -0,0 +1,24 @@
while True:
try:
change = float(input("Change: "))
if change > 0:
break
except:
ValueError
cents = int(change * 100)
quarters = int(cents / 25)
cents = cents % 25
dimes = int(cents / 10)
cents = cents % 10
nickels = int(cents / 5)
pennies = int(cents % 5)
cents = int(quarters + dimes + nickels + pennies)
print(cents)