Taking a vacation, Getting there


#1



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


Help me


Replace this line with your code. 

def hotel_cost(nights):
    return 140 * nights
    
def plane_ride_cost(city):
    if city == "Charlotte":
        return nights * 183
    elif city == "Tampa":
        return nights * 220
    elif city == "Pittsburgh":
        return nights * 222
    elif city == "Los Angeles":
        return nights * 475

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


#2

There is no variable called nights there ? (for ex. nights * 183)
You just have to return the numbers there depending on the city names.


#3

yeah i found out that later, btw can u help me out with this. i cant get what is wrong with my code

def rental_car_cost(days):
return days * 40

if days >= 7:
    return (days * 40) - 50
elif days >= 3 and days < 7:
    return (days * 40) - 20

#4

when function reaches at return statement, it simply halts the execution and gets out of the functions body, that line should be at last line of function's body , also makes sure if indentation done right!


#5

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