3. Getting There


#1

I'm having trouble with Getting There. I keep getting the error code: " It looks like plane_ride_cost does not return 183 when the city is Charlotte."

This is my code which has Charlotte as 183.

No idea why it won't work.

def hotel_cost(nights):
    hotel_cost
    return 140 * nights
    
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"

Thanks Ben


#2

It has a string that looks like 183. These values should be numbers, not strings.


#3

Thanks, just figured that out. 183 instead if "183"


#5

Thanks mtf. I was facing the same problem.


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.