2.7. Miles-per-Gallon - Python

Words
74
Reading
1 min
Listen
Play
10y

Starting out with Python, Third Edition, Tony Gaddis

Chapter 2

Programming Challenges

7. Miles-per-Gallon

A car’s miles-per-gallon (MPG) can be calculated with the following formula:

MPG = Miles driven / Gallons of gas used

Write a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car’s MPG and display the result.

Starting out with Python, Third Edition, Tony Gaddis

Happy Steeming Everyone! :)

2.7. Miles-per-Gallon - Python | Ecency