Not Printing. Plan your trip


#1

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:
cost-=50
elif days>=3:
cost-=20
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)


#2

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.


#3


trip_cost is there and is not deleted -_-


#4

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


#5

I can't tell if it doesn't print


#6

Which can be remedied by adding code that prints.

print trip_cost(args, go, here)

#7

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


#8

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.


#9


#10

But, it is there.:sob:


#11

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


#13