Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the file gas _ prices.txt ( linked below ) you will find weekly U . S . gas prices for 1 9 9 4
In the file gasprices.txt linked below you will find weekly US gas prices for through The format is : as follows:
:
:
:
:
:
:
:
:
:
:
Write a program that reads this file and outputs a report containing the low price, average price, and high prices for each year, as well as the average prices for each month of each year, sorted by year and month, as follows:
:
Low: $ Avg: $ High: $
January $
February $
March $
April $
May $
June $
July $
August $
September $
October $
November $
December $
:
Low: $ Avg: $ High: $
January $
February $
March $
April $
May $
June $
July $
August $
September $
October $
November $
December $
Redirect your report to a file named gasreport.txt Submit that file along with your code in a file named gasprices.py
To redirect output from a program to a file, use in the command line when you run your program, as shown in this example:
python gasprices.py gasreport.tx
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