Need Help On Transportation


Hi I tried number of times and I keep getting the same thing
Oops, try again. Your code looks a bit off. Feel free to peek back at earlier exercises if you need a refresher! Your code threw the following error: unexpected indent (python, line 14)
Could you please help out!


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): total=days*40
    return total
    if days>=7:
elif days>=3 and days<7:
return total


this should be the correct format, even if i myself have a little error atm.

hope i helped :slight_smile:

edit: just delete line 19 ^^


What looks to be the problem is your line that has
def rental_car_cost(days): total=days*40

That "total=days*40 should be on the next line and indented.


Just add 4 spaces or a Tab before this line (elif days>=3 and days<7:)..
ur error was caused by the indentation error u have to place 'elif' just below the 'if', otherwise if .... elif...else will not work


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