Hey, You Never Know!


hey my code shows me this error
Oops, try again. trip_cost('Pittsburgh', 1, 11) returned 402 instead of the correct value 413

and i don't know how to fix it

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
        return 0
def  rental_car_cost(days):

    cost = 40 * days
    if days >= 7:
        return cost - 50
    elif days >= 3:
        return cost -20
        return cost

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


This should be spending_money.


still the same error


So what does trip_cost function look like now? There should not be a line break.


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

it gave me a new error

Oops, try again. Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Take a look at the console window for the error message from the interpreter.


Show us the entire function, including the header line, please.


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


Be sure to indent the return statement.


thank you it's work now