第 9 章

动手试一试

  1. 下面是我为温度转换程序增加的一些注释:
  1. # tempconv1.py
  2. # program to convert a Fahrenheit temperature to Celsius
  3. Fahr = 75
  4. Cel = (Fahr - 32) * 5.0 / 9 #decimal division, not integer
  5. print "Fahrenheit = ", Fahr, "Celsius = ", Cel