Write a function with the name get_weather_report that takes the temperature as an argument.
- If the temperature is less than 22, it should return "Cold".
- If the temperature is greater than or equal to 22 and less than 35, it should return "Warm".
- If the temperature is greater than or equal to 35, it should return "Hot".
def get_weather_report (temperature):
if temperature<22:
return "Cold"
if temperature>=22 and temperature<35:
return "Warm"
return "Hot"
if __name__ == '__main__':
temperature=int(input("Enter temperature: "))
print("The temperature is", get_weather_report(temperature))
Comments
Leave a comment