Question: By python language .. Write a program (mileage.py) that reads gallons and miles from input file mileage.txt and compute the ratio column and the average
Write a program (mileage.py) that reads gallons and miles from input file "mileage.txt" and compute the ratio column and the average miles per gallon and write results in a new file. The results must be also displayed on screen as shown in Figure 1. 12.89 287 10.30 200 5.25 120 Figure 1. Sample input file "mileage.txt Gallons Hiles Rat io 12.89 10.39 5.25 287 280 120 19.42 22.86 he Overall Average was 21.5 Figure 2. Sample screen output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
