Help on taking a vacation 3

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?

I only get an error stating “Oops, try again. Did you create a function called plane_ride_cost”

I ran it and it work for me

#Try to
to refresh the page or change browser

1 Like

I tried to refresh didn’t work and niether did another browser
this is the code i used to put on the other browser which is the same no edits
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

what to do now

i fixed it oh my lord i just put the def on the edge of the left line as in i backspaced it and now it worked
i understand because defining something is like a big dog in the process and it needs control so it
need to touch because is non conditional thanks for your help! Have a nice day!

2 Likes