Answer to Question #195329 in Python for srinivas

Question #195329

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".


1
Expert's answer
2021-05-19T05:05:17-0400
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))





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS