Taking a Vacation 6/7 NEED HELP


Hello, I need help completing this level. It's not working
Level: Taking a vacation 6/7

My code:

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
        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, spending_money):
    return plane_ride_cost(city) + hotel_cost(days) + rental_car_cost(days) + spending_money()

This is the error it gives me:

File "python", line 29
return plane_ride_cost(city) + hotel_cost(days) + rental_ca r_cost(days) + spending_money()
SyntaxError: invalid syntax


may be this:


spending_money is an argument that is a variable(just value) not a function. and so on remove parenthesis '()'


nope, not working :frowning:


oum, better to enter link of course to help you better and faster,

attention to Instructions
if you are in here: Plan Your Trip! https://www.codecademy.com/en/courses/python-beginner-P5YtY/1/6?curriculum_id=4f89dab3d788890003000096

1- print that return the function
2- and use car cost and hotel host and plane cost(you need for go here) and your additional money for buy thing in here for yourself :wink:.

you use rental_car_cost again. this is my function.

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

then you should call this with that argument in that instructions and print that.
if you are in step 6 not need print.


thx, worked!!! :slight_smile:


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


hi how are this fine evening ok goodbye have a good day/ nigh


Now I realized that s sensetive to whitespcaes. You Need to be carefull at space beginnig of lines allways. This step is important.