Transportation!


#1



Can't seem to get past this stage, brings me an error message about returning a value of -10 instead of 40
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):
    cost = days * 40
    if rental_car_cost >= 7:
        return =  cost - 50
    elif rental_car_cost >=3:
        return = cost - 10
    else:
        return cost


#2

Check your maths. Your code is correct, but the maths that are run is not.


#3

I think there have three errors in this coding.
1. The condition after "if" and "elif" should replace "rental_car_cost" with "days", because the condition should be triggered while the number of days >= 7 or 3, but "rental_car_cost" wasn't defined as the number of days but the total cost.
2. It should be " return cost - 50" instead of "return = cost - 50".
3. the second return formula in the "elif" is mistyped.


#4

elif rental_car_cost >=3: is wrong, because >=3 can be 7 and more (thus it interacts with the first if statement, which says that you get more money off by using the car for
if days>=7 .

As pointed out previously, use days instead of rental_car_cost

My code looks like this for that part and I get through to the next stage.

elif days<7 and days>=3:
    cost-=20

#6