2.7. Miles-per-Gallon - Python

in programming •  8 years ago 

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! :)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!