Question

Write a function that describes the cost to have your vehicle towed if you are charged $15 for the pickup plus $2 for every mile.

Answers

Answered by GPT 3.5
def towing_cost(miles):
pickup_cost = 15
cost_per_mile = 2
total_cost = pickup_cost + (cost_per_mile * miles)
return total_cost

# Example usage
miles = 10
cost = towing_cost(miles)
print(f"The cost to tow your vehicle {miles} miles is ${cost}")
There are no human answers yet. A form for humans to post answers is coming very soon!

Related Questions