29 February

Sample program from today

r = raw_input("What do you want convert, F or C? ")

if r == "C" or r == "c":
    c = float(raw_input("Enter temp in C: "))
    f = 9/5.0 * c + 32
    print "Temp in F is ", f
else:
    f = float(raw_input("Enter temp in F: "))
    c = 5/9.0*(f-32)
    print "Temp in C is ", c

if f > 80:
    print "THat's hot."
else:
    if f < 40:
        print "That's cold."
    else:
        print "That's comfortable"

 

©2012 Christopher League · some rights reserved · CC by-sa