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))
Answers: 2
Computers and Technology, 22.06.2019 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
Computers and Technology, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
Computers and Technology, 23.06.2019 09:00
Which is the highest level of the hierarchy of needs model? a. humanity b. intrapersonal c. team d. interpersonal
Answers: 1
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
Your program must define and call the following driving_cost() function. Given input parameters driv...
Health, 20.10.2020 18:01
Mathematics, 20.10.2020 18:01
Mathematics, 20.10.2020 18:01
Mathematics, 20.10.2020 18:01
Computers and Technology, 20.10.2020 18:01
Computers and Technology, 20.10.2020 18:01
Chemistry, 20.10.2020 18:01
Chemistry, 20.10.2020 18:01
Mathematics, 20.10.2020 18:01
Business, 20.10.2020 18:01
History, 20.10.2020 18:01
Mathematics, 20.10.2020 18:01
Business, 20.10.2020 18:01
Advanced Placement (AP), 20.10.2020 18:01