Question: Weather Analyzer You are tasked with developing a Weather Analyzer that helps identify trends in daily temperatures. The user will input the recorded temperatures for
Weather Analyzer You are tasked with developing a Weather Analyzer that helps identify trends in daily temperatures. The user will input the recorded temperatures for several days, and your program will determine: The number of heat waves or more consecutive days with temperatures above deg C The longest cold streak number of consecutive days with temperatures below deg C The average temperature of the entire dataset. At the end, your program will display the results, including the days where heat waves and cold streaks occurred. Requirements: The user will input the temperatures as a list of numbers in Celsius separated by spaces. Use lists to store the temperatures and analyze the data. Implement the following features: o Count heat waves: A heat wave is defined as or more consecutive days where the temperature is above deg C o Find the longest cold streak: A cold streak is defined as consecutive days with temperatures below deg C You need to find the longest streak of such days. o Calculate the average temperature of all the days. Example InputOutput: Sample Input : Enter temperatures for each day separated by space: Sample Output : Number of heat waves: Longest cold streak: days Average temperature: deg C Sample Input : Enter temperatures for each day separated by space: Sample Output : Number of heat waves: Longest cold streak: days Average temperature: deg C Hints: To find heat waves, you can loop through the list and check for or more consecutive temperatures above deg C To find the longest cold streak, you will need to track the number of consecutive days below deg C and update the longest streak accordingly. The average temperature can be calculated using the sum function divided by the number of days
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
