Any ideas?


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
        return 'NOPE'

def rental_car_cost(days):
    pago = 40 * days
    if days >= 7:
        pago -= 50
        return pago
    elif days >= 3:
        pago -= 20
        return pago
        return pago

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

Oops, try again. trip_cost('Los Angeles', 5) raised an error: 'int' object is not iterable


the sum of the sum, how does that work?



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

Oops, try again. trip_cost('Pittsburgh', 1) raised an error: 'int' object is not iterable


i am not paying attention. sum() is to get the sum of an iterable, like a list.

integers are not iterable. just use + to add integers together, don't use sum() at all


I love you :heart_eyes: