Taking a Vacation [] 3. Getting there


#1



https://www.codecademy.com/en/courses/python-beginner-P5YtY/1/2?curriculum_id=4f89dab3d788890003000096#

For some reason the error keeps popping up saying:

Oops, try again. Did you create a function called plane_ride_cost?


I've carefully over checked the code to see if there are any spelling mistake and there are non


Please help :slight_smile:


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
    else city =="Los Angeles":
        return 475


#2

Have the exact same issue atm. function defined as above and getting the same error on running it.


#3

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
else city =="Los Angeles":
return 475
this is my code and it gives me the same error code ...........
pls help


#4

Change the else statement to an elif statement. Else statements are supposed to be blank, they are not suppose to have conditionals.


#5

Hey i just tried that out and it worked
Thank you :slight_smile:


#6

#7

trentton, you seem to have the exact same problem, you should be able to solve it with chipjumper36731 solution

If problems persist, make a new topic, topics are for helping the person who created the topic, not to report you have the same problem. since georgeboots.99 problem is now solved, this topic is now closed