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'''
distance = float(raw_input("Enter distance in
litresPer100K = float(raw_input("Enter economy (ltr/
pricePerLitre = float(raw_input("Enter fuel price per
litre ($): "))
cost = distance / 100 * litresPer100K * pricePerLitre
print "Fuel cost is $%0.2f" % cost
Any help Appreciated !!!
Edited 6 Years Ago by lebron: n/a