Plane ride


#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!
So I couldn't find my other Topic I made so I am re posting this on here for now answer if you know it thanks!


Been stuck on this for several hours
#2

take a close look at the indention of your code, your plane_ride_cost is nested inside your hotel_cost, it shouldn't be

also these line:

print hotel_cost
hotel_cost(5)

it could just be one line:

print hotel_cost(5)

in fact, that would be better, and it should also be outside the function (think how to indent so it is outside the function). Next time, please create your own topic. Thank you


#3

This problem was fixed 2 days ago when the problem happened and when I start a new topic I always start out with a greeting message and not on someone else's topic


#4

Wait I see you split groups from the other topic that was not me with the problem on the other one unless you did something but everything is fine have a nice day!