mirror of https://github.com/me50/kukemuna.git
25 lines
371 B
Python
25 lines
371 B
Python
|
|
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)
|