[Tutor] Syntax Question

John Miller jmillr at umich.edu
Thu Sep 11 20:12:19 EDT 2003


The code runs fine, but the equation is structured wrong. A pair of 
parentheses is needed to return the correct answer:

C = (F-32) * (5.0 / 9.0)

  John Miller

On Thursday, September 11, 2003, at 05:16 PM, "Alan Gauld" 
<alan.gauld at blueyonder.co.uk> wrote:
>> def main():
>>     Fahrenheit = input("What is the Fahrenheit Temperature?")
>>     Celsius = (5.0 / 9.0) * Fahrenheit - 32
>>     print "The Temperature is", Celsius, "degrees Celsius."
>
> This all looks OK to me.




More information about the Tutor mailing list