Help on taking a vacation 3


#1

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!


#2

Hi this line

def plane_ride_cost(city)

you wrote plane_ride_cost instead of plan_ride_cost


#3

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


#4

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


#5

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


#6

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?


#7

yes it == and i put that


#8

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


#9

Yes its that then here

if city == "Chalotte":

you wrote "Chalotte" instead of "Charlotte"


#10

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


#11

same error i will look into the problem


#12

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

#13

These lines

print hotel_cost
hotel_cost(5)

put it like that

print hotel_cost(5)

#14

that was a copy\paste error


#15

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


#16

post again you code and format it


#17

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

`


#18

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

#19

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


#20

but what error do you get?