4. Transportation - couldn't find another topic that really helped


#1


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


File "python", line 19
if days >= 7:
^
IndentationError: unindent does not match any outer indentation level

 
def hotel_cost(nights):
    print 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 "no value"
        
def rental_car_cost(days):
        cost = 40 * days
    if days >= 7:
        cost +=(-50)
    elif days >= 3 and days < 7:
        cost +=(-20)    
    return cost


I am having trouble with the above code. I have tried to copy and paste and rewrite the script, Still nothing, I would complain but it seems that every time I do, I find that the problem is human error (most of the time). So If there is any advice or corrections I am missing, please advice.


#2

Hi @dik_rich,

This statement is indented too much ...

        cost = 40 * days

Indent it the same amount as this line that follows it ...

    if days >= 7:

#3

wow lol an indent held me up for an entire day. Thank you.


#4