Hey, You Never Know!


#1



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

    cost = 40 * days
    if days >= 7:
        return cost - 50
    elif days >= 3:
        return cost -20
    else:
        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)
    +money(spending_money)


#2

This should be spending_money.


#3

still the same error


#4

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


#5

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.


#6

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


#7

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

#8

Be sure to indent the return statement.


#9

thank you it's work now


#12