Intro to
Programming
with Python

Fall 2012
course
navigation

temperature conversion

# convert.py | Jim Mahoney | Sep 2010 # Input Celsius from user, print corresponding Fahrenheiht # Based on material in Zelle's "Python Programming" # # WARNING : This program has a bug. # # $ python convert.py # Temperature in Celsius is: 20 # Temperature is 52 degrees Fahrenheit # def main(): celsius = input("Temperature in Celsius is: ") fahrenheit = (9/5) * celsius + 32 print "Temperature is ", fahrenheit, " degrees Fahrenheit" main()
http://cs.marlboro.edu/ courses/ fall2012/python/ code/ temperature/ convert
last modified Wednesday September 5 2012 9:45 pm EDT