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 03:30
Write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removedproblems 1.1 write a computer program to calculate the three-phase fault current for a fault at f in figure 1.16, with the network normal, and with one line at a time removed 20 power system relaying from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0+j0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the stub-end fault í• figure 1.16 problem 1.1 system data for figure 1.16 from to positive sequence 0.0+j0.1 0.05j0.15 0.04 j0.2 0.01 jo.i 0.015 + j0.15 0.01 j0.19 0.01 +j0.19 0.03+j0.1 0.0+j0.08 6 6 6 from service. the positive-sequence impedance data are given in the accompanying table. use the commonly made assumption that all prefault resistance values are (1.0 + j 0.0) pu, and neglect all resistance values. calculate the contribution to the fault flowing through the cb b1, and the voltage at that bus. for each calculated case, consider the two possibilities: cb b2 closed or open. the latter is known as the “stub-end” fault.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Which of the following commands is more recommended while creating a bot?
Answers: 1
question
Computers and Technology, 22.06.2019 23:50
List a few alternative options and input and output over the standerd keyboard and monitor. explain their functioning in details.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
1. which of the following is not an example of an objective question? a. multiple choice. b. essay. c. true/false. d. matching 2. why is it important to recognize the key word in the essay question? a. it will provide the answer to the essay. b. it will show you a friend's answer. c. it will provide you time to look for the answer. d. it will guide you on which kind of answer is required.
Answers: 1
You know the right answer?
Your program must define and call the following driving_cost() function. Given input parameters driv...
Questions
question
Mathematics, 20.11.2020 22:20
Questions on the website: 13722360