Taking a Vacation


#1



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


Showing Error Message : It looks like rental_car_cost returns None instead of the correct amount (100) for 3 days.


def hotel_cost(nights):
    return 140*nights

def plane_ride_cost(city):
    if city=="Charlotte":
        return 183
    if city=="Tampa":
        return 220
    if city=="Pittsburgh":
        return 222
    if city =="Los Angeles":
        return 475

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


#2

get rid of your last elif statement. Its not necessary and your code should pass.


#3

Thanks it worked... :slight_smile:


#4

Good! Glad to have helped! :smiley:


#5

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