Pull it Together 5/7

#1

please need help to solve error File "python", line 17
if days >=7:
^
IndentationError: unindent does not match any outer indentation level

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
return plane_ride_cost("Charlotte")``````

def rental_car_cost(days):
cost = 40 * days
if days >=7:
return cost - 50
elif days >= 3:
return cost - 20
else:
return rental_car_cost
def tripcost(city, days):
return planeridecost(city) + hotelcost(days) + rentalcar_cost(days)

#2

Try this:

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

#3

def hotel_cost(days):
return 140 * days

city = raw_input("What city are you visiting? ")
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:

days = raw_input("How many days will you need a rental car? ")
def rental_car_cost(days):
total= 40 * days
if days >= 7:
total -= 50
elif days >= 3:
total -= 20