Pull It Together 5/7 trip_cost('Charlotte', 0) raised an error: unsupported operand type(s) for -: 'str' and 'int'


#1


keep getting this erroe trip_cost('Charlotte', 0) raised an error: unsupported operand type(s) for -: 'str' and 'int'


Replace this line with your code. 

def hotel_cost(night):
    return 140 * night

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 days >= 7:
        cost = cost - 50
        return cost
    elif days<7 and days >=3:
        cost = cost - 20
        return cost
    else:
        return cost;


def trip_cost(city, days):
    return rental_car_cost(city) + hotel_cost(days) + plane_ride_cost(city)


#2

Hi this line

return rental_car_cost(city) + hotel_cost(days) + plane_ride_cost(city)

this part

rental_car_cost(city)

you ar going to rent a car for days so you should change city with days


#3

oh my gosh thank you very much


#4

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