subject
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
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:00
Perform the following tasks: a. create a class named testclass that holds a single private integer field and a public constructor. the only statement in the constructor is one that displays the message “constructing”. write a main()function that instantiates one object of the testclass. save the file as testclass.cpp in the chapter 08 folder. run the program and observe the results. b. write another main()function that instantiates an array of 10 testclass objects. save the file as test class array.c . run this program and observe the results.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
question
Computers and Technology, 24.06.2019 17:30
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
You know the right answer?
Your program must define and call the following driving_cost() function. Given input parameters driv...
Questions
question
Mathematics, 05.03.2021 17:10
question
Mathematics, 05.03.2021 17:10
question
Mathematics, 05.03.2021 17:10
question
Mathematics, 05.03.2021 17:10
question
English, 05.03.2021 17:10
question
Mathematics, 05.03.2021 17:10
Questions on the website: 13722362