# celsius6.py, by chaynes@indiana.edu def celsius(fahrenheit): """ Return the result of converting the Fahrenheit temperature to celsius. >>> celsius(32) 0.0 >>> celsius(212) 100.0 >>> """ return 5.0/9 * (fahrenheit - 32) def main(): """ Repeatedly prompt for tempearture in degrees Fahrenheit and print its conversion to degrees Celsius. Exit if 'quit' is entered. """ while True: text = raw_input("Degrees Fahrenheit, or 'quit': ") if text == 'quit': return f_temp = float(text) c_temp = celsius(f_temp) print f_temp, "degrees Fahrenheit is", c_temp, "degrees Celsius" if __name__ == '__main__': main()