Computers and Technology
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))

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, Molly05
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is 50e0bf08e5b671@ualwgypg91wa5wl. uzo9kbud3qjwddygd5.vng -
Answers: 1
image
Computers and Technology, 23.06.2019 17:00, quanharris2k19
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
image
Computers and Technology, 23.06.2019 22:50, atifgujar
An environmental protection agency study of 12 automobiles revealed a correlation of 0.47 between engine size and emissions. at 0.01 significance level, can we conclude that there is a positive association between the variables? what is the p value? interpret.
Answers: 2
image
Computers and Technology, 23.06.2019 23:30, jamalchris9353
Worth 50 points answer them bc i am not sure if i am wrong
Answers: 1
Do you know the correct answer?
Your program must define and call the following driving_cost() function. Given input parameters driv...

Questions in other subjects:

Konu
Mathematics, 13.10.2020 21:01