[Tutor] Syntax Question

A.M. Kuchling amk at asti-usa.com
Thu Sep 11 16:11:26 EDT 2003


On Wed, Sep 10, 2003 at 09:00:08PM -0400, Orion72738 at cs.com wrote:
> ------------------
> #convert.py
> #   A program to convert Fahrenheit temperatures to Celsius

I hope those lines of dashes aren't in your script; they'd certainly
be syntax errors.  Put a '#' in front of them to turn that line into a
comment.

>     Fahrenheit = input("What is the Fahrenheit Temperature?")

input() expects a valid Python expression as input.  Use raw_input()
instead to get a string, and convert it to a floating-point number
with float().

--amk




More information about the Tutor mailing list