Taking a vacation - trip cost function


Why does it think I deleted the trip cost function?

def hotel_cost(days):

    return 140 * days

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 = 40 * days
    if days >= 7:
        cost -= 50
    elif days >= 3:
        cost -= 20
    return cost    
def trip_cost(city, days, spencing_money):
    return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days) + spending_money
    print trip_cost("Los Angeles", 5, 600)


OK, I see the misspelling of spending money. But now I get Oops, try again.
It looks like nothing was printed to the console!


Remove the indentation on the last line. print should be outside of the function block.


I tried this exact code and I keep getting, "Oops, try again. trip_cost should take exactly 3 arguments!" I get this whether I have three arguments or not. Why is this happening?


HI can you post your code?


Your code should work , if you correct the misspelling and remove the indentation on the last line.


Oh duh... I forgot to add spending_money to the line with def trip_cost(city, days, spending_money):
Haha, I am dumb


my code does not working please give me suggestion..


HI next don't post on an old post 1 month later you should create a new topic..


in your call function trip_cost() you wrote Loss Angeles instead of Los Angeles the same in plane_trip_cost()..


thank you i got it :relaxed:


since now it technically isnt more than a month old anymore should i create a topic or can i post a question here?


HI it's better if you create a new topic..


ok tnx.. im will get right on it