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


#1



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
    else:
        if city is "Pittsburgh":
            return 222
        if city is "Charlotte":
            return 183
        else:
            return "Not Available"


#2

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

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


#3

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