Plan your trip


#1

here is my code please tell me what's wrong with it????????? when I click on the save and submit this message appears : it looks like nothing was printed to the console!:confused:angry:

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

return total

def trip_cost(city,days,spending_money):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
print trip_cost("Los Angeles",5,600)


#2

I put the
print trip_cost("Los Angeles",5,600)

after define my function and it worked but I don't know why is it? :smirk:
and the rest of code is at the end.

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


#3

but at the console nothing printed but Ive finished this course


#4

:smiley:Tanx it helped