4. transportation What wrong


#1

Whats wrong with this block of code I see nothing wrong
It keeps giving me this error
File "python", line 15
return 40 * days - 50
^
IndentationError: expected an indented block

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):
if days >= 7:
return 40 * days - 50

elif days >= 3:
return 40 * days - 20

elif days < 3:
return 40 * days


#2

Your problem is that is says if you get 7 days then you get 50 taken AWAY from the total!


#3

actually, the code works. all he has to do is press tab once on the if/elif and twice on the returns. :smile:


#4

oops...guess THAT'S why mine wasn't working!


#6

you have to make sure your indenting