Question: USING PYTHON USING PYTHON USING PYTHON @lile, etc. You need to offer a brief description of the program at the beginning of your file and
USING PYTHON
USING PYTHON
USING PYTHON


@lile, etc. You need to offer a brief description of the program at the beginning of your file and include documentation throughout your code. In Python, comment lines start with the # symbol. You may also highlight the text you want to be commented, click Format/Comment Out Region. Constraints: Display any numerical output with 2 digits after the decimal point Process: Write a Python program process temperature data. 1. Ask the user for the number of months to process 2. Validate the number of months to make sure it's a number between 1 and 48 3. Ask the user for the temperature data for the highest and lowest temperatures for each month and store the data in a 2-dimensional array. Note that these values can be decimal values such as 85.5, etc. 4. Validate the temperature values to be between -40 and 40 degrees 5. Store the average temperature for each month in a list 6. Store the average temperature for the highest and the lowest temperature in a list 7. Display a report that shows the temperature values along with the average temperature for the month and the average temperature for the highest and lowest temperatures 8. Find and display the highest temperature reading 9. Find and display the lowest temperature reading 10. Find and display the grand average of all temperature values You may want to create your 2-dimensional array as: EMPTY = 0 temp = [[EMPTY for c in range(2)] for r in range(12)] The following table tells us that we have 3 months of temperature readings. In Month 1, the highest temperature during the month was 85 degrees and the lowest temperature was 50 degrees (a lot of fluctuations in a month!). NOTE: you are not storing the month name in the list. The following is just an example of possible data values. Month 1 Month 2 Month 3 85 92 90 50 73 80 Sample Interaction: Note that this is just a sample test case. Your code should work for any set of input. I did not show a sample run with invalid input, but you should test for invalid input. Enter the number of months: 3 Enter the temperature values for each month 85 50 92 73 90 80 ***REPORT*** 85.00 50.00 67.50 92.00 73.00 82.50 90.00 80.00 85.00 89.00 67.67 The highest temperature reading = 92.00 The lowest temperature reading = 50.00 The grand average of all temperature values = 78.33
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
