4.) Transportation Equations Not Getting The Right Numbers


So once again I am stumped probably by some typing error but I keep getting the Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days. The only thing I could think of was that the minus sign is not right...

def rental_car_cost(days):
    return 40 * days
    if days >= 7:
        return 40 * days - 50
    elif days >= 3:
        return 40 * days - 20
    return rental_car_cost


This is the only line to execute.

cost = days * 40
if days >= 7:
    cost -= 50
elif days >= 3:
    cost -= 20
return cost


I am sorry. Can you explain a little more lol Its probably simple and right in front of my nose xD


Ah thank you! I was wondering if I needed to add cost or if I could simply return everything thanks!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.