Rikard Bosnjakovic wrote: > On 4/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >> I found this site and I'm practicing coding and I write this script, but >> I'm unsure why its not working. Everything goes well until it gets to the >> part where it tries to calculate the formula. Inputs work fine anyone >> know what I did wrong? >> > > if type == "c": > cel = (5/9)*(temp_int-32) > a side-note: 5/9 is 0 in Python 2.5 and earlier. '/' defaults to integer division if both sides are integers as well. What you'd want to do is 5.0/9 or 5/9.0 or 5.0/9.0 or just 0.555555555 same applies to your 9/5 below. > print "Farhrenheit %d is equal to %d celcius.\n" % (temp_int, cel) > elif type == "f": > far = (9/5)*(temp+32)
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor