# # PrograM: temperature.py # Author: James Tam # Version: August 19, 2010 # A program that converts a Celsius temperature to it's equivalent in # Fahrenheit. def introduction (): print """ Celsius to Fahrenheit converter ------------------------------- This program will convert a given Celsius temperature to an equivalent Fahrenheit value. """ # Shows but doesn't modify the temperatures. def display (celsius, fahrenheit): print "" print "Celsius value: ", celsius print "Fahrenheit value:", fahrenheit # With a given temperature in Celsius this function will calculate and # display the equivalent Fahrenheit value. def convert (): celsius = input ("Type in the celsius temperature: ") fahrenheit = celsius * (9 / 5) + 32 display (celsius, fahrenheit) # Main function def main (): introduction () convert () main ()