From health tips to tech hacks, find it all on IDNLearn.com. Discover in-depth and trustworthy answers to all your questions from our experienced community members.
Ask the user for the path to the data file.
Open and read the data file the user provided.
If any errors occur opening or reading from the data file, the exception must be caught and the user must be told that an error occurred. The raw exception text must not be visible to the end user.
The data file is in the following format:
,
Note the day of the month is not in the data file
The month is represented by the standard 3-character abbreviation.
The data must be read into a 2-dimensional list, each inner element consists of the Month and the rainfall total. Here is a list representing the first 4 days of the data (your program must store the data in this format): [['Nov', 0.0], ['Nov', 0.0], ['Nov', 0.09], ['Nov', 0.18]]
After the data is read and stored in a 2-dimensional list, use compression to separate the data into separate lists, one list for each month.
For each month’s list, use compression again to compute the average rainfall for each month
Finally display the average daily rainfall on a bar chart similar to this:
Sagot :
Thank you for being part of this discussion. Keep exploring, asking questions, and sharing your insights with the community. Together, we can find the best solutions. Discover the answers you need at IDNLearn.com. Thank you for visiting, and we hope to see you again for more solutions.