What am i doing wrong


Taking a Vacation
Getting There

def hotel_cost(nights):
    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
        return 'none'


Charlotte is a city, because it is a city, it should be a string. Not a variable


def hotel_cost(nights):
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
return 'None'

it gives this error now-
Oops, try again. It looks like plane_ride_cost does not return 475 when the city is Los Angeles.


since when is Los Angeles written with underscore in the name? I always just use a space



Originally I filled out the return number as:

return "183"
instead of:
return 183

Is it the case that numbers never should be in between comma’s (or what do you call “” ?)

Thank you


Why did you revive a 10 month old topic for this?

Because using quotation marks, its a string. lets say we go to Charlotte for 3 days, using strings results in:

print "420" +  "183" # 420183
print 420 + 183 # 603

that is why we don’t use quotation marks.


Mea culpa, I don’t have a lot of experience using fora. Should I have started a new topic for my question?

Thanks for your reply, this is clear now.


yes, the guidelines say:

Don’t divert a topic by changing it midstream.

which is what you do when you ask your own question in an existing topic