Getting there


#1

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?


#2

string comparison is case sensitive.


#5

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


#6

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

like "city"


#7

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


#8

Nope. I don't understand.


#9

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


#10

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