Not Printing. Plan your trip


What does this mean?(Oops, try again. Oops! Did you accidentally delete the trip_cost function?)

def hotel_cost(night):
return 140*night
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):
cost= days*40
if days>=7:
elif days>=3:
return cost

def trip_cost (city, days, spending_money):
return plane_ride_cost(city)+hotel_cost(days)+retal_car_cost(days)+spending_money()
print Trip_cost('Los Angeles', 5, 600)


I think it would be a good idea to test the code yourself, that would get you more information about what's wrong with it. Call the function that it's complaining about with appropriate arguments.


trip_cost is there and is not deleted -_-


Sure. But does it do what it should? Test it.


I can't tell if it doesn't print


Which can be remedied by adding code that prints.

print trip_cost(args, go, here)


Something like this: print trip_cost('Los Angeles, 5, 600)


That's not valid syntax but yes, if you fix the string by adding a closing quote then that will call your function and print the result. Make sure that the arguments are in the correct order as well.

If the code is as in your first screenshot, then you'll get an exception which tells you what went wrong. That's information you need, that's a good thing, now you can fix it.



But, it is there.:sob:


Which brings us back to my reply from 12 days ago! Have you tested it?