« first day (2271 days earlier)      last day (1070 days later) » 

2:15 PM
def convert(temp, from_, to):
    if from_ == to: return temp #not strictly necessary, but might save us an imprecise round-trip through floats
    to_kelvin_formulas   = {"C": lambda t: t + 273.15, "F": lambda t: (t + 459.67) * 5 / 9 "K": lambda t: t}
    from_kelvin_formulas = {"C": lambda t: t - 273.15, "F": lambda t: t * 9 / 5 - 495.67,  "K": lambda t: t}
    return from_kelvin_formulas[to](to_kelvin_formulas[from_](temp))
1 message moved from Python
 

« first day (2271 days earlier)      last day (1070 days later) »