Question: Hello could you solve this practice program for my python class? -Make sure to follow all the requirements and also match the output give on

Hello could you solve this practice program for my python class?
-Make sure to follow all the requirements and also match the output give on the third slide.
- Use the code examples given in the last 2 slides
 Hello could you solve this practice program for my python class?
-Make sure to follow all the requirements and also match the output
give on the third slide. - Use the code examples given in
the last 2 slides Program #2 - Rainfall Stats (Rainfall_stats.py): Problem Definition:
Create a Python program that shows monthly rainfall and some summary statistics.
Call program rainfall_stats.py. Do not forget general and specific comments. Coding: Initialize

Program #2 - Rainfall Stats (Rainfall_stats.py): Problem Definition: Create a Python program that shows monthly rainfall and some summary statistics. Call program rainfall_stats.py. Do not forget general and specific comments. Coding: Initialize a list of months and list them in lower case and in abbreviated format. Initialize a list of monthly rainfall. Use the data in the screenshot provided to populate both lists. Your program to use the range() function to loop the lists. Your program should also provide basic rain statistics. Instead of manually showing the data for each month by writing 12 print statements, use a for loop with the range() function to loop through both lists to show the data formatted in two columns. After you show the data from the two lists, calculate and show some basic stats: total rainfall and average rainfall. Make sure you use formatted strings to show output as shown in the screenshot provided. Output: Your output should be in columnar format and be formatted as shown in the screen shot below. Stats should also appear formatted as shown. Screenshot of Output (Rainfall Stats): - Dallas, TX Average Monthly Rainfall - 2018 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 1.90in. 2.37in. 3.06in. 3.20in. 5.15in. 3.23in. 2.12in. 2.03in. 2.42in. 4.11in. 2.57in. 2.57in. Source: www.rssweather.com Total rainfall: Average rainfall: 34.73 2.89 [Finished in 0.15] Pseudocode / Comments (Rainfall Stats): #initialize a list with names of the months all lowercase abbreviated #initialize a list with average monthly rainfall corresponding to months #print report header - Average Monthly Rainfall #use for loop with the range function - pass len of month list #print month and average rainfall by accessing temporary variable # print credit line showing source of data # use sum function to find the total rainfall and assign to total variable # dividing total by len function of list and assign to average variable #display total and average rainfall for year Code Examples (Rainfall Stats): How to use the range() function: # use range function to loop through both lists pass len of list # for value in range(12): for value in range(len(month_rain)): # print out month & average rainfall by accessing index of each list print(f"{month_list[value].title()}\t\t{month_rain[value]: 2f}in.") How to use sum() function and find average: use sum function to find the total rainfall and assign to variable total = sum(month_rain) # calc average by dividing total by len funct on list and assign to var Waverage = total / 12.0 average total / len(month_rain) How to format output (note average rainfall is left aligned): # display total and average rainfall for year print() print(f'Total rainfall: \t{total:.2f}') print(F'Average rainfall: \t{average: >5.2f}') print()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!