Sep-23-2018, 04:40 AM
(This post was last modified: Sep-23-2018, 04:44 AM by abdullahali.)
Hello, I am trying to write a program that reads the user’s fuel used and distance travelled from the console, passes
the entered values to the fuel_efficiency function to perform the computation, obtains the function’s
return value, and then prints a message to the console that reports the user’s fuel eciency rating. My code is not working past the return part, anyhelp appreciated
fuel_used = Int(Input(“fuel used: “))
distance_travelled = int(input(“distance travelled: “))
fuel_efficiency = (“fuel_used / distance * 100: “)
Return fuel_efficiency
Print(“fuel efficiency rating of a car that uses”, fuel_used, “liters, and travels”, distance_travelled, “km is”, fuel_efficiency )
the entered values to the fuel_efficiency function to perform the computation, obtains the function’s
return value, and then prints a message to the console that reports the user’s fuel eciency rating. My code is not working past the return part, anyhelp appreciated
fuel_used = Int(Input(“fuel used: “))
distance_travelled = int(input(“distance travelled: “))
fuel_efficiency = (“fuel_used / distance * 100: “)
Return fuel_efficiency
Print(“fuel efficiency rating of a car that uses”, fuel_used, “liters, and travels”, distance_travelled, “km is”, fuel_efficiency )