Tuesday 21 February 2012

Convert Celsius temp to Fahrenheit in Python


# convert.py (its file name you can use anything)
# A program to convert Celsius temps to Fahrenheit
#write this programe in python IDE(integrated development enviroment ) [Green color for commenting]


def main():
Celsius = input("What is the Celsius temperature? ")
      #logic or formula to for converting temparature
Fahrenheit = (9.0 / 5.0) * celsius + 32  
print "The temperature is", Fahrenheit, "degrees Fahrenheit."
main():

No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}