Getting there doesn't run?


#1



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

I"m currently going through "Taking a vacation: 3. Getting There" and I've gone through tons of posts on the forums, but it seems like I've formatted it correctly, however, whenever I try to run the code, it send me back a message: "Oops, try again. Did you create a function called plane_ride_cost?"
Whats exactly is happening?


def hotel_cost(nights):
    return 140*nights

def plane_ride_cost(city):
    if city == "Charlotte":
        return 183
    elif city == "Tampa":
        return 220
    elif city == "Pittsburg":
        return 222
    elif city == "Los Angeles":
        return 475


#2

Hi this line

elif city == "Pittsburg":

you wrote "Pittsburg" instead of "Pittsburgh" it's missing the h at the end.


#3

hi i dont know why but it keeps asking if i created the function "plane_ride_cost" but it does not work. could you help?

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


#4

Hi you should change all your = with ==


#5

try writing the string like 'Los Angeles' i.e., in commas...


#6

What is wrong with the bellow code. I am getting error message "Did you create a function called plane_ride_cost?"

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 ciry == 'Los Angeles':
return 475


#7

NV I found what the issues was.


#8

Im getting the same problem with "Did you create a function called plane_ride_cost. Can you tell me what you did to fix it?


#9

I don't remember what I did to fix it. Can you share your code and I will be happy to take a look at it.