Use @staticmethod and @classmethod to add factory methods and utility functions to a class.
Step 1 of 80%
Step 1 of 8
Define a class called Temperature
pythonLn 1, Col 1
1
2
3
4
5
6
7
# Build a Temperature class from scratch## Requirements:# - __init__(self, celsius): store celsius# - to_fahrenheit(self): return celsius * 9/5 + 32# - @classmethod from_fahrenheit(cls, fahrenheit): create Temperature from Fahrenheit# - @staticmethod is_freezing(celsius): return True if celsius <= 0