Getting there


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 angles":
        return 475

where did i go wrong?


string comparison is case sensitive.


Also, check your spelling. It seems as if "Los Angeles" is spelled incorrectly.


I thought that the instructions say that 'city' should be a string.

like "city"


no, the function parameter is never a string, it will hold a string:

def example(city):
   print city
example("hold string")

see? city will hold a string, slight difference


Nope. I don't understand.


city is a string, the function parameter is just a placeholder until you pass a string as argument when you call the function. Did you even run the code i provided?

This should have been covered already, you can always revisit exercises if you don't remember


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