Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # constants - current U.S. currency values
- penny = 0.01
- nickel = 0.05
- dime = 0.1
- quarter = 0.25
- one = 1
- ten = 10
- twenty = 20
- fifty = 50
- hundred = 100
- again = 'y'
- while again == 'y':
- pennies = int(raw_input("number of pennies: "))
- nickels = int(raw_input("number of nickels: "))
- dimes = int(raw_input("number of dimes: "))
- quarters = int(raw_input("number of quarters: "))
- ones = int(raw_input("number of one dollar bills: "))
- tens = int(raw_input("number of ten dollar bills: "))
- twenties = int(raw_input("number of twenty dollar bills: "))
- fifs = int(raw_input("number of fifty dollar bills: "))
- hundreds = int(raw_input("number of hundred dollar bills: "))
- total = pennies * penny+ \
- nickels * nickel + \
- dimes * dime + \
- quarters * quarter + \
- ones * one + \
- tens * ten + \
- twenties * twenty + \
- fifs * fifty + \
- hundreds * hundred
- print 'You have a total of :', total
- again = raw_input("Do you wish to continue? (y/n) ")
Add Comment
Please, Sign In to add comment