1

How Do I read from a file for a coin sorter program with a limit on an amount of coins? Where do I go from this code?

total = float(raw_input("Enter the total purchase: "))
amount = float(raw_input("What amount is given: "))
bills = int(amount - total)
change = int(round(((amount - total) - bills) * 100))

quarters = change/25
change -= quarters * 25
dimes = change/10
change -= dimes * 10
nickels = change/5
pennies = change

print "Bills:", bills
print "Quarters:", quarters
print "Dimes: ", dimes
print "Nickels:", nickels
print "Pennies:", pennies

Where do I write in a file?

mhlester
  • 22,781
  • 10
  • 52
  • 75

0 Answers0