14
如何用Python舍入到两位小数?
在此代码的输出(华氏转摄氏度)中,我得到了很多小数。 我的代码当前如下所示: def main(): printC(formeln(typeHere())) def typeHere(): global Fahrenheit try: Fahrenheit = int(raw_input("Hi! Enter Fahrenheit value, and get it in Celsius!\n")) except ValueError: print "\nYour insertion was not a digit!" print "We've put your Fahrenheit value to 50!" Fahrenheit = 50 return Fahrenheit def formeln(c): Celsius = (Fahrenheit - 32.00) …