Question: Exercise 2 : In some countries, a vehicle's fuel efficiency is measured in miles per gallon. In other countries, the efficiency is measured in litres

Exercise 2: In some countries, a vehicle's fuel efficiency is measured in miles per gallon. In other countries, the efficiency is measured in litres per 100km. For example, 32 miles per Imperial gallon is equivalent to approximately 8.83 litres per 100km.
You are going to write Python statements that convert miles per gallon to litres per 100km. One Imperial gallon is equal to approximately 4.54609 litres. One mile is equal to approximately 1.60934km.
Hint: we recommend that, before you write any Python code, treat this as a math problem and derive a formula for converting miles per gallon to litres per 100km, using the conversion factors listed in the previous paragraph. Verify that the units in the conversion factors cancel out properly.
In PyTutor, click Edit this code. The memory model from Exercise 1 will disappear. Delete the code in PyTutor's editor, then type four assignment statements:
 Exercise 2: In some countries, a vehicle's fuel efficiency is measured

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!