Pull it Together?


#1

I'm not really sure what to do on this? it says I haven't defined trip_cost

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
else:
return 'empty'
def rental_car_cost(days):
cost= 40 * days
if days >= 7:
cost -= 50
elif days >= 3:
cost -= 20
return cost
def trip_cost(city,days)
return sum plane_ride_cost(city) + rental_car_cost(days) + hotel_cost(days)
print trip_cost(city,days)


#2

Hi @remicahrobertson,

The term sum does not belong here ...

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

The + operators are sufficient for specifying addition.

What is the purpose of this statement? ...

    print trip_cost(city,days)

#3

thank you so much! It took a while but I only had a few minor errors


#4