6/7, I can not figure this out!


#1

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):
    if days >=7:
        return days*40-50
    elif days >=3:
        return days * 40 - 20
    else:
        return days * 40

def trip_cost(city,days, nights):
    return plane_ride_cost(city)+rental_car_cost(days)+days*140

#2

I haven't looked yet, but if my recall is correct, the arguments are city, days and spendingMoney. The return value from trip_cost() should read,

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

or if you prefer,

lodging = hotel_cost(days)
air_fare = plane_ride_cost(city)
car_rent = rental_car_cost(days)

return lodging + air_fare + car_rent + spendingMoney