Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# Calculate denominations in dollars, quarters, dimes and cents from a starting sum (in cents)
amount = 439
print('Total: ', amount)
dollars =(amount-amount%100)/100
amount -=dollars*100
quarters = (amount-amount%25)/25
amount -= quarters*25
dimes = (amount-amount%5)/5
amount -= dimes*5
cents = amount
print('Dollars: ', int(dollars))
print('Quarters: ', int(quarters))
print('Dimes: ', int(dimes))
print('Cents: ', int(cents))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment