Pull it all together


#1



https://www.codecademy.com/en/courses/python-beginner-P5YtY/1/4?curriculum_id=4f89dab3d788890003000096


i can't pull it all together
just says
Oops, try again. trip_cost('Pittsburgh', 1) raised an error: unsupported operand type(s) for -=: 'str' and 'int'


it wants me to use
def double(days)


def hotel_cost(days):
    return 140*days
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
    else:
        return 0
def rental_car_cost(days):
# cost car $40 a day
    cost = 40 * days
    if days >=7:
         cost -=50
    elif days >= 3:
         cost -=20
    return cost
def trip_cost(days,city):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)


#2

The order of the arguments determines the order of the parameters.

The error is stating that your days parameter is a string when it should be a number.


#3

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