Transportation


#1



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

rental_car_cost returns 120 instead of 100


def hotel_cost (nights):
    return 140 * nights
    
def plane_ride_cost (city):
    if city == "Charlotte": # if city is "Charlotte"
        return 183 #return 183
    elif city == "Tampa":
        return 220
    elif city == "Pittsburgh":
        return 222
    elif city == "Los Angeles":
        return 475
        
def rental_car_cost (days):
    return 40 * days
    if days >= 7:
        return rental_car_cost - 50
    elif days >= 3 and days < 7:
        return rental_car_cost - 20
    return cost


#2

where have you defined cost?? You need to define cost before you actually call it:

cost = days * 40

Then you can return the cost - 50, instead of rental_car_cost. And don't forget, no "and". It should just be:

elif days >= 3:
return "hello!"

#3

make a variable called cost of value to it of 40*days so
cost = 40 *days

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


#4

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