Please Help - 5/Pull It Together - Whitespace and Indentation


#1

Please help. I think from my error message below, that I have completed something incorrect with spacing / indentation, however for the life of me I cannot see what is incorrect. Can anyone tell me what is wrong with my code please.

Code:
def hotel_cost(nights):
return 140.00 * 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 0

def rental_car_cost(days):
cost = 40.00 * days
if days >= 7:
cost (40.00 * days) - 50
elif days >=3:
cost (40.00 * days) - 20
return cost
else:
cost = 40.00 * days
return cost
def trip_cost(city, days):
return hotel_cost(days) + plane_ride_cost(city) + rental_car_cost(days)

print trip_cost("Los Angeles", 10)

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

Thanks everyone
Josie


#2

Hi.
Put your code between three backquotes/backticks before your code and three backquotes/backtick after your code. It will show your code with indents.
Without it no one will be able to help you.


#3

Hi,

Thanks for that, this is the first time I posted to this forum. I thought it would copy and paste exactly as on the python codecademy screen. I just amended for the back-quotes, but instead of editing, I created a new forum. Hopefully, it came up properly on that post, with the back-quotes, I have to go check now. But I wanted to say thanks for help.
Josie