0

This is problem part of my assesment I've done but my assesment says use a function to calculate the fuel cost and function should take 3 parameters : distance,economy(as litres per 100 kms) , and fuel price per litre. The function should return the total cost of trip. Could you please help me out with this ,,,

'''Calculate the cost of fuel for a road trip'''

def main():

distance = float(raw_input("Enter distance in

kilometres: "))

litresPer100K = float(raw_input("Enter economy (ltr/

100km): "))

pricePerLitre = float(raw_input("Enter fuel price per

litre ($): "))

cost = distance / 100 * litresPer100K * pricePerLitre

print "Fuel cost is $%0.2f" % cost

main()

Any help Appreciated !!!

*Edited 6 Years Ago by lebron*: n/a