HELP: please help with 8. transpotation


#1



Please help

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

i keep getting an error message that says:
Oops, try again. It looks like rental_car_cost returns -10 instead of the correct amount (40) for 1 days.

this is my code

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

#2

this condition:

if days <= 7:

means 7 days or less. 50$ discount should only be given for 7 or more days, not 7 days or less


#3

ooh

thank you for helping


#6

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