I’m drawing a blank here. I did this in an online compiler. It appears my answers match the solution, but none of the tests are passing. What did I miss?
Given the size of a fuel tank, the current fuel level, and the price per gallon, return the cost to fill the tank all the way.
tankSizeis the total capacity of the tank in gallons.
fuelLevelis the current amount of fuel in the tank in gallons.
pricePerGallonis the cost of one gallon of fuel.The returned value should be rounded to two decimal places in the format:
"$d.dd".
def cost_to_fill(tank_size, fuel_level, price_per_gallon):
cost = (tank_size - fuel_level) * price_per_gallon
result = f"\"${cost:,.2f}\""
return str(result)