class TemperatureConverter: def __init__(self, temp: float): self.temp = temp fahrenheit_to_celsius = lambda self: round((self.temp - 32) * (5 / 9), 2) celsius_to_fahrenheit = lambda self: round((self.temp * 9 / 5) + 32, 2)
- class TemperatureConverter:
def __init__(self, temp: float):self.celsius = round((temp - 32) * (5 / 9), 2)self.fahrenheit = round((temp * 9 / 5) + 32, 2)def fahrenheit_to_celsius(self) -> float:return self.celsiusdef celsius_to_fahrenheit(self) -> float:return self.fahrenheit- def __init__(self, temp: float): self.temp = temp
- fahrenheit_to_celsius = lambda self: round((self.temp - 32) * (5 / 9), 2)
- celsius_to_fahrenheit = lambda self: round((self.temp * 9 / 5) + 32, 2)