7 Taking a Vaction


#1
    def hotel_cost(n):
    hotel_cost = n * 140
    return hotel_cost
    
def plane_ride_cost(c):
    if c == "Charlotte":
        return 183
    elif c == "Tampa":
        return 220
    elif c == "Pittsburgh":
        return 222
    elif c == "Los Angeles":
        return 475
    else:
        return "Wrong Answer"
    
def rental_car_cost(d):
    cost = d*40
    if d >= 7:
        cost = cost - 50
        return cost
    elif d >= 3:
        cost = cost - 20
    rental_car_cost = cost
    return rental_car_cost

def trip_cost(c,d,m):
    rental_car_cost(d)
    hotel_cost(d)
    plane_ride_cost(c)
    spending_money= m
    cost = hotel_cost(d)+plane_ride_cost(c)+rental_car_cost(d)+spending_money
    return cost

Output is

Ive chased the error down to the plane cost function but cant figure out whats going wrong.


#2

You don't need any of these lines.

If in doubt, use the variable names given in the lesson instructions. Be sure to check indentation.


#4