Help with the Python basics, floats and functions - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Help with the Python basics, floats and functions

HeavymetalvepHeavymetalvep Posts: 5Member
Write a python program that uses functions. The program should ask the user the same 2 questions 3 times. The first question is "How many miles did you travel before you filled up your tank?" (Make sure this is stored as a float).
The second question will be "How many gallons did it take to fill up your tank?" (Again, make sure this is a float)
Use a function to ask the 2 questions. (re-using the code for the questions). Then use a third function to calculate the average miles per gallon of the three sets, and display the overall average to the user.
Remember, the first function should include both questions.




Sign In or Register to comment.