![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 19.04.2021 01:20 Geo777
Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles.
Ex: If the function is called with: 50, 20.0 , 3.1599
my error : Traceback (most recent call last):
File "main. py", line 17, in
mpg = float(input())
EOFError: EOF when reading a line
def driving_cost(mil, mpg, dpg, gal, i):
gal = mil / mpg
result = gal * mpg
return result
if __name__ == '__main__':
mil = float(input())
mpg = float(input())
dpg = float(input())
gal = 0
i = 0
result = driving_cost(mil, mpg, dpg, gal, i )
print('{:.2f}'.format(result))
print('{:.2f}'.format(result))
print('{:.2f}'.format(result))
![ansver](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 22:40, hePandaKing3689
State the parts of a variable declaration?
Answers: 2
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 03:30, adrianVocke5685
Kou converged his word document to a powerpoint document. when he received the powerpoint, he was missing material. which most likely explains why the material was missing? a it did not have a proper heading b he incorrectly copied and pasted it c he did not save his document properly d there was not enough space in powerpoint
Answers: 1
You know the right answer?
Your program must define and call the following driving_cost() function. Given input parameters driv...
Questions in other subjects:
![Konu](/tpl/images/cats/en.png)
English, 23.12.2020 02:00
![Konu](/tpl/images/cats/ekonomika.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 23.12.2020 02:00
![Konu](/tpl/images/cats/obshestvoznanie.png)
![Konu](/tpl/images/cats/es.png)
Spanish, 23.12.2020 02:00
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/istoriya.png)
History, 23.12.2020 02:00
![Konu](/tpl/images/cats/istoriya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 23.12.2020 02:00