Help on taking a vacation 3

Good Afternoon Ladies and Gents. I am having a problem on this code I put in:
def hotel_cost(nights):
return 140 * nights

print hotel_cost
hotel_cost(5)

def plane_ride_cost(city):
    if city "Chalotte":
        return 183
    elif city "Tampa":
        return 220
    elif city "Pittsburgh":
        return 222
    elif city "Los Angeles":
        return 475

when I enter this it says,“Did you create a function called plan_ride_cost?”
Of course I did or did I miss something and if I did please tell me the solution.
Thanks in advance to you all!

Hi this line

def plane_ride_cost(city)

you wrote plane_ride_cost instead of plan_ride_cost

1 Like

Heh wow what a brain fart I just had my bad thank you!:joy:

Wait no it is plane_ride_cost i just typed in plan_ride_cost and it said did you create a function called
plan_ride_cost but even that won’t work need help again

Wait no it is plane_ride_cost i just typed in plan_ride_cost and it said did you create a function called
plan_ride_cost but even that won’t work need help again

you got the right name def plane_ride_cost(city) its just that its missing something between city and all the name of your city here

    if city "Chalotte":
        return 183
    elif city "Tampa":
        return 220
    elif city "Pittsburgh":
        return 222
    elif city "Los Angeles":
        return 475

DO you know what you should put between them?

yes it == and i put that

beacause it is comparing the city to one of the ones stored in the console and i understand that but it still won’t work

Yes its that then here

if city == "Chalotte":

you wrote “Chalotte” instead of "Charlotte"

My goodness sorry for bothering you but thanks alot! Have a nice day!

same error i will look into the problem

This is my code now:def hotel_cost(nights):
return 140 * nights

print hotel_cost
hotel_cost(5)

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

These lines

print hotel_cost
hotel_cost(5)

put it like that

print hotel_cost(5)

that was a copy\paste error

1 Like

Nope the same thing keeps happening I think it may be a bug but i am not sure what is your input?

post again you code and format it

Like this
def hotel_cost(nights):
return 140 * nights

 print hotel_cost(5)
 
 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

Now it could be an indent problem you code should be like that

def hotel_cost(nights):
    return 140 * nights

print hotel_cost(5)

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

But where would the indention be because i just ask if i made a plan_ride_cost and not a indention error
I think they would let you know but i am not sure

but what error do you get?