mirror of https://github.com/me50/kukemuna.git
automated commit by check50 [check50=True]
This commit is contained in:
commit
9079d67841
|
|
@ -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)
|
||||
Loading…
Reference in New Issue