Taking a vacation: Getting there


#1



Taking a vacation : Getting there , exercise


i get error: "did u make plane_ride_cost function?"

whats wrong with my code?


def hotel_cost(nights):
    return 140 * nights

def plane_ride_cost(city):
    if city == "Charlotte":
        return 183 * nights
    elif city == "Tampa":
        return 220 * nights
    elif city == "Pittsburgh":
        return 222 * nights
    elif city == "Los Angeles":
        return 475 * nights


#2

Inside your plane_ride_cost(city) function you're using a "nights" variable that's only known within this function (it's not a global one).

Try expressing in a different way, that's known by the plane_ride_cost function, the amount of nights.


#3

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