It looks like rental_car_cost returns 96 instead of the correct amount (100) for 3 days.

Why 100 and not 96?

Replace this line with your code. 
def hotel_cost(nights):
    return 140*nights
def plane_ride_cost(city): 
    if city == "Charlotte":
        return 183
    elif city == "Tampa":
        return 220
    elif city == "Pittsburgh":
        return 222
    elif city == "Los Angeles":
        return 475
def rental_car_cost(days):
    total =  40*days
    if days >= 7:
        total -= (50 * total) / 100
    elif days >= 3:
        total -= (20 * total) / 100
    return total


So your code looks good, I wrote mine out a little bit more so I'll include mine. You took the easier shortcut way using the -= function but I'll include what I did.

def rental_car_cost(days):
total = days * 40

(Yours looks the same so good job there.)

Next, I'll show my if and else if statement.

if days >= 7:
return total - 50

elif days >= 3:
return total - 20

return total

So I can't really tell what your goal was in this so I can't say exactly what you did wrong, but tell me if this helps!


I tried your way and it worked. My thought was that i sould subtract the percentage of the discount from the total. Anyway thanks a lot for the help.


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