[Tutor] Syntax Question
Orion72738 at cs.com
Orion72738 at cs.com
Wed Sep 10 22:00:08 EDT 2003
I am very new to programming, and i am trying to make this program convert
Fahrenheit to celsius and vice-versa. When I try to run it, I get syntax errors.
Please help! Thank you! (what i have is below)
____________________________________________________________________
Input the temperature in degrees Fahrenheit (call it Fahrenheit)
Calculate Celsius as (5/9)celsius + 32
Output Fahrenheit
------------------------------------------------------------------------------
------------------
#convert.py
# A program to convert Fahrenheit temperatures to Celsius
------------------------------------------------------------------------------
------------------
def main():
Fahrenheit = input("What is the Fahrenheit Temperature?")
Celsius = (5.0 / 9.0) * Fahrenheit - 32
print "The Temperature is", Celsius, "degrees Celsius."
main()
More information about the Tutor
mailing list