Question
Q1) Rainfall Statistics PYTHON Design a program called RainfallStatistics.py that contains the following functions: main function, totalRainfall, averageMonthlyRainfall, lowestHighestRainfall, and largerThanN The main function generates
Q1) Rainfall Statistics PYTHON
Design a program called RainfallStatistics.py that contains the following functions: main function, totalRainfall, averageMonthlyRainfall, lowestHighestRainfall, and largerThanN
The main function generates a list called monthlyRainfallData of 12 random floating-point numbers between 0 and 10. Each number represents total rainfall for each month.
totalRainfall: This function accepts the list of monthly rainfall data and returns total rainfall for the year average
MonthlyRainfall: This function accepts the list of monthly rainfall data and returns average monthly rainfall
lowestHighestRainfall: This function accepts the list of monthly rainfall data and returns a tuple of four values: lowest rainfall, corresponding month, highest rainfall, corresponding month.
For example: (2.82, February, 4.95, September)
Assume that each index of the list of twelve numbers corresponds to a month. For example 0=January, 1=February,11=December. largerThanN This function accepts the list of monthly rainfall data and a floating-point number n.
This function displays all rainfalls in the list that are greater than the number n and the corresponding months.
For example, assume n = 3.24. Then, the function displays:
4.23 : October
3.87 : September
5.56 : November
The main function builds the random list, accepts the number n, and calls each of the functions.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started