Need Help (Plan Your Trip!)


I don't really know whats wrong in here, it says looks like nothing was printed

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 "Not Really"

def rental_car_cost(days):
    cost = 40*days
    if days >= 7:
         return cost - 50
    elif days >= 3:
         return cost - 20
        return cost

def trip_cost(city,days,spending_money):
    return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spending_money
    print trip_cost("Los Angeles", 5, 600)


Hi @dradark ,

Because your code is not formatted, it is difficult for other users to read and debug it. After code is been pasted into the editing window for posting, you can format it by selecting it, and then by clicking the </> button above the editing area. This will enable us to see important details, such as the indentation and underscores.

We cannot see your indentation, and so cannot be sure of the nature of the problem, but it could be that you indented this statement ...

print trip_cost("Los Angeles", 5, 600)

If so, then it did not execute, because it was part of the same trip_cost function that you were attempting to call with it.


thank @geomaticmashups, i hope i fixed this