Question: Using python, write code for problem. The text file Mileage.txt is used in this problem and i have pasted contents of the file. Please also

Using python, write code for problem. The text file Mileage.txt is used in this problem and i have pasted contents of the file. Please also put screenshot of your code.

Using python, write code for problem. The text file Mileage.txt is used

Prius,2.1 Camry,4.1 Sebring,4.2 Mustang,5.3 Accord,4.1 Camry,3.8 Camry,3.9 Mustang,5.2 Accord,4.3 Prius,2.3 Camry,4.2 Accord,4.4 

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.11 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.51. 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 drivin Gal 2.1 Model Accord Camry Camry Mustang Gal 4.3 2.3 4.2 Model Model Prius Camry Sebring Mustang Gal 3.8 3.9 5.2 ccord Prius Camry Accord 4.2 5.3 Model Prius Camry 25.00 Sebring 23.81 Accord 23.44 Mustang 19.05 MPG 45.45 FIGURE 5.51 Outcome of Programming Project 6

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!