Plan Your Trip! (7) printing trip cost


#1

I am on number 7 of Taking a vacation.
The error message says "Oops, try again. It looks like nothing was printed to the console!"

Can someone tell me what I'm missing on the last line of 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
    elif city == "Los Angeles":
        return 475

def rental_car_cost(days):
    rent = 40 * (days)
    if days >= 7:
        rent -= 50
    elif days >= 3:
        rent -= 20
    return rent
    
def trip_cost(city, days, spending_money):
    return hotel_cost(days) + rental_car_cost(days) + plane_ride_cost(city) + spending_money
    print trip_cost("Los Angeles", 5, 600)


#2

These are the instructions it's asking for me to do:

"Instructions
After your previous code, print out the trip_cost( to "Los Angeles" for 5 days with an extra 600 dollars of spending money.

Don't forget the closing ) after passing in the 3 previous values!"


#3

I discovered my code was right, but the print trip_cost was not supposed to be indented. It never even gave an indentation error :frowning:


#4

Okay, good you saw that! :slight_smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.