I need help on 4.!


#1

I've been trying to figure this out for a really long time. Please give help with an explanation on what I did wrong. Thank You!

Error Message:
Oops, try again. It looks like rental_car_cost returns 120 instead of the correct amount (100) for 3 days

def hotel_cost(nights):
    return 140 * nights
def plane_ride_cost(city):
    print city
    plane_ride_cost("hold string")
    if city == "Charlotte":
        return 183
    if city == "Tampa":
        return 220
    if city == "Pittsburgh":
        return 222
    if city == "Los Angeles":
        return 475
def rental_car_cost(days):
        return days * 40
        cost == days * 40
        if days >= 7:
            return cost - 50
        elif days >= 3:
            print cost - 20

#2

That line is causing the return immediately. 3 days, 40 per day, 120 dollars. Suggest remove that line.

The next line creates a cost variable. Suggest only subtract the discount as applies in each case, and in the final line,

return cost

#3

Thank You! This helped a lot!


#4

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