#!usr/bin/env python """ hw02_1.py Asks the user for a dollar amount and converts it into Euros, using current exchange rate values """ EURO_TO_DOLLAR = 0.72 # Exchange rate on April 22, 2014 dollars = raw_input("How many Dollars do you wish to convert to Euros? :") try: dollars = float(dollars) except ValueError: print dollars, "is not a number!" else: print dollars, "dollars =", dollars * EURO_TO_DOLLAR print "euros" print "Thank you!"
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