Function Name Error. Please Help!


#1



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


I'm receiving an error asking if I created the function name. I've already verified function name is typed correctly & even tried copy pasting name from the instructions.


I expected to pass this lesson


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
    else:
        return "N/A"


#2

Missing closing quote.

Notice how the syntax highlighting looks a little off past that point?

Not asked for in the instructions. The function should default to None when no city is found. This is what Python returns when there is no return value. Remove those two lines of code.


#3

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