Transportation


#1



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


what am i doing wrong, it keeps saying did you create a function called rental_car_cost ?


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
        
    def rental_car_cost(days):
        rent = days*40
        if days >=7:
            rent -= 50
        elif days >=3:
            rent -= 20
        else:
            return rent
.


#2

actually i fixed that...everything was extra indented...but now its saying rental_car_cost returns None instead of the correct amount (100) for 3 days.


#3

Your return statement shouldn't be in else. rent should be returned always.
Remove your else and indent return rent line like if and elif


#4

got it! works now, thanks