Help! pull it together


#1

i've been writing this code for the last chapter.Here it is:

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):
cost=40*days
if days>=7:
cost=cost-50
elif days>=3:
cost=cost-20
return cost
def trip_cost(days,city):
cost=plane_ride_cost+rental_car_cost+hotel_cost;
return cost

it return this error message:

File "python", line 19
def trip_cost(city, days, spending_money):
^
IndentationError: unindent does not match any outer indentation level

What should i do???


#2

Try to mess around with it a little and see if that works, I think I will be around there soon so I can help later maybe. I think.


#3

Yes, I don't know what you did wrong, but here is my code so you can compare. Keep in mind it might be something like you forgot a space or something.

WARNING: CODE BELOW, ONLY NERDS LIKE ME CAN SCROLL DOWN

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
else:
return 40 * days
def trip_cost(city, days):
return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)

Except for indents, it didn't do indents for some reason.


#4

I don't know if this helps or not but the second line up from the bottom you have a semi colon after hotel_cost instead of a colon.