- Python Basic Use The File Called Gas Price Txt The File Contains Weekly Average Price For A Gallon Of Gas Between April 1 (64.64 KiB) Viewed 30 times
PYTHON BASIC Use the file called Gas Price.TXT, the file contains weekly average price for a gallon of gas between April
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
PYTHON BASIC Use the file called Gas Price.TXT, the file contains weekly average price for a gallon of gas between April
PYTHON BASIC Use the file called Gas Price.TXT, the file contains weekly average price for a gallon of gas between April 5th, 1993, and ending on August 26th, 2013. 04-05-1993:1.068 04-12-1993:1.079 04-19-1993:1.079 04-26-1993:1.086 05-03-1993:1.086 05-10-1993:1.097 05-17-1993:1.106 Each line in the file contains the average price for a gallon of gas on a specific date, Each line is formatted in the following way: MM-DD-YYYY:Price Write a program that reads the content of the file and perform the following calculations: Average Price per year: Calculate the average price of gas per year, for each year in the file. Average Price Per Month: Calculate the average price for each month in the file Highest and Lowest Price Per year: for each year in the file determine the date and amount for the lowest price, and the highest price. List of Price, Lowest to Highest: Generate a text file that lists the dates and prices, sorted from the lowest to highest. List of Prices Highest to Lowest: Generate a text file that lists the dates and prices, sorted from highest price to the lowest.