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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:40, hePandaKing3689
State the parts of a variable declaration?
Answers: 2
image
Computers and Technology, 23.06.2019 09:00, 19youngr
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
image
Computers and Technology, 24.06.2019 18:00, bloop3r
Why is a multiview sketch drawinf different from other sketches like isometric, two point, and oblique
Answers: 1
image
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
Spanish, 23.12.2020 02:00
Konu
History, 23.12.2020 02:00