Calculating a taxi fare between two companies (Python)?

Viewed 25

I'm having some trouble with my assignment and don't know how to get started. Here's the problem

Company A charges $4.80 flat plus $1.00/mile

Company B charges $3.20 flat plus $1.20/mile

Write a function to find which company is the cheapest as a function of the distance to travel. It should take a single argument (the distance) and output a string (either "Company A is cheaper." or "Company B is cheaper.")

def cheapest_company(a, b):
   price = 0
0 Answers
Related