Pull it Together


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

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

Oops, try again. trip_cost('Pittsburgh', 5) raised an error: cannot concatenate 'str' and 'NoneType' objects

HELP ,What's the matter?


I can't help you if I can't see your code.


could you see my code now?


This might be a syntax error if so, I'm going to need you to post your formatted code. If you don't know how to format code in your posts, please refer to:


oh dear my,it must be a bug.the codes must be def trip_cost(city,days):,not def trip_cost(days,city):.thx all the same.


It's not so much a bug, as it's just Codecademy's SCT being picky.


You are so nice,thank you!


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