automated commit by check50 [check50=True]

This commit is contained in:
kukemuna 2024-03-22 10:45:14 +02:00
commit 9079d67841
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)