To convert to celcius of farenheit.

x = int(raw_input("enter the value to be converted :"))

thevalue = raw_input('c or f')

if thevalue == 'f':

print 'f == %d' % (9/5*(x+32))

elif thevalue == 'c':

print 'c == %d' % (5/9*(x-32))

No comments:

Post a Comment