Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
new to coding
#1
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 )
Reply


Messages In This Thread
new to coding - by abdullahali - Sep-23-2018, 04:40 AM
RE: new to coding - by Gribouillis - Sep-23-2018, 05:28 AM
RE: new to coding - by ichabod801 - Sep-23-2018, 01:33 PM
RE: new to coding - by gruntfutuk - Sep-30-2018, 01:49 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020