Question: please solve this and demostrate proper code. Uriving is expensive. Write a program with a car's gas milage (miles/gallon) and the cost of gas (dollars/gallon)

Uriving is expensive. Write a program with a car's gas milage (miles/gallon) and the cost of gas (dollars/gallon) as floating-point input, and output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print( f{ your_value1:.2f\} \{your_value 2:.2f \} \{your_value 3:.2ff) Ex if the input is: 20.03.1599 where the gas mileage is 20.0 miles/gallon and the cost of gas is $3.1599/ gallon, the output is 3.1611.8579.00 Note: Real per-mile cost would also include maintenance and depreciation \begin{tabular}{l|c} Ua \\ Acriviry & 2.14. AAB. Driving costs \end{tabular} 0/10 main.py Load dofault template. 5 milesPerGallon = float (input ()) 6 dollarsPerGallon =f float ( input ()) 7 print('\{:.2f\} {:.2f}{:.2f} '. format(driving_cost(20,milesPerGallon, dollarsPerGallon), driving_cost(75, milesPe 8 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box. Enter program input (optional) If your code requates input values, provide them here Your program expects input Input(fromabove) Program errors displayed here Traceback (most recent call last): File "main,py", line 5, in milesperGallon - Eloat (input ()) EOFError: EOF when reading a iine
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
