Pulling it together


#1


https://www.codecademy.com/en/courses/python-beginner-P5YtY/1/4?curriculum_id=4f89dab3d788890003000096

File "python", line 15
SyntaxError: 'return' outside function

I expect to see a successful message


def hotel_cost(nights):     #Where hotel cost per night is $140
    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
def rental_car_cost(days):
    cost = days * 40
if days >= 7:
    return cost- 50    
elif days >= 3:
    return cost - 20
return cost
def trip_cost(city,days):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(days)


#2

Hi @kingboy411,

You did not indent the portion of the rental_car_cost function block that follows this line ...

cost = days * 40

#3

thanks a lot for your response @appylpye


#4

On your final line you need to pass city rather than days to the plane_ride_cost function.


#5

thank alot, got it
. it now works


#6