4. Transportation


#1

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,):
    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):
        return 40*days 
        if days >= 7:
            cost - 50
            return 240
        elif days >= 3:
            cost - 20
            return 100
        else:
            return cost

#2

what if i rent a car for 5 days? it should return 40 * 5 - 20 which is 180. Your code just returns 100.


#3

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