7. Plan Your Trip! not printing to console


#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
else:
“sorry”

def rental_car_cost(days):
cost = days * 40
if days >= 7:
return cost - 50
elif days >= 3 and days <= 7:
return cost - 20
else:
return cost

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

print trip_cost("Los Angeles",5,600)

the error i keep getting is this
Oops, try again. It looks like nothing was printed to the console!


#2

the function call executes the function, so it should be placed outside/after the function, not nested inside the function


#3

what do you mean can you copy and paste the code or show me how to do it?


#4

that is a violation of the guidelines

in python, what determines if something is nested inside/outside a function?


#5

can you show me the code instead of copy and pasting text


#6

thank you for your help
i just forgot to erase the indent on it


#7