# counting_change.py # A program that counts change and provides a total # Get change (quarters, dimes, nickels, pennies, half dollars, and Saqagawegen dollars) from the user # Calculate the collective value of the currency # Ask if the users has any half dollars or saquwegen dollars # if (yes) add to total, if (no) provide original total # Get coin info from user quarters, dimes, nickels, pennies = input("Enter your change (Q,D,N,P): ") print regChange = quarters * .25 + dimes * .10 + nickels * .05 + pennies * .01 specialCoin = input("Do you have any half dollars or Sacagawea dollars? (Y/N): ") specialCoin = specialCoin.lower() if specialCoin.lower() == 'y': print ("Ok") else: print ("That's fine.") print quarters, dimes, nickels, pennies
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question