It is showing error., but I can't understand what is it?


I have written this code for Taking a Vacation., but it is continuosly showing me this error
the error show is :
"Oops, try again. It looks like plane_ride_cost does not return 475 when the city is Los Angeles."

def plane_ride_cost(city):
    if city is "Los Angeles":
        return 475
    elif city is "Tampa":
        return 220
        if city is "Pittsburgh":
            return 222
        if city is "Charlotte":
            return 183
            return "Not Available"


You've used the is keyword instead of the equality operator == :slight_smile:

Good explanation of the difference between is and == here:


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