Question: Python Coding assistance Needed: 6. Fuel Economy A fuel-economy study was carried out for five models of cars. Each car was driven 100 miles, and

Python Coding assistance Needed:

Python Coding assistance Needed: 6. Fuel Economy A fuel-economy study was carried

6. Fuel Economy A fuel-economy study was carried out for five models of cars. Each car was driven 100 miles, and then the model of the car and the number of gallons used were placed in a line of the file Mileage.txt. Table 5.11C shows the data for the entries of the file. Write a program to display the models and their average miles per gallon in decreasing order with respect to mileage. See Fig. 5.512. The program should create a dictionary of five items, with a key for each model, and a two-tuple for each value. Each two-tuple should be of the form (number of test vehicles for the model, total number of gallons used by the model). TABLE 5.11 Gallons of gasoline used in 100 miles of driving. Model Gal Model Model Prius 2.1 Accord 4.1 Accord Camry 4.1 Camry 3.8 Prius 2.3 Sebring 4.2 Camry 3.9 Camry 4.2 Mustang 5.3 Mustang 5.2 Accord 4.4 Model Prius Camry MPG 45.45 25.00 Sebring 23.81 Accord 23.44 Mustang 19.05

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!